How can developers ensure consistency in time representation when using the NOW() function in PHP across different servers or environments?

When using the NOW() function in PHP to get the current timestamp, developers may encounter inconsistencies in time representation across different servers or environments due to differences in server configurations or time zones. To ensure consistency, developers can set the default time zone to a specific value using the date_default_timezone_set() function at the beginning of their script.

<?php
// Set the default time zone to UTC
date_default_timezone_set('UTC');

// Get the current timestamp
$currentTime = date('Y-m-d H:i:s');

echo $currentTime;
?>