I was just wondering what, if any, are the benefits and draw backs in storing server dates/times over GMT dates/times? I’ve noticed that many popular open source scripts store the current server time and later apply an offset at runtime. Joomla, PunBB, PHPBB, Textpattern, Coppermine, etc all use that method, as far as I know.
Here’s a basic example of how they handle dates:
// From configuration settings.
$timezone_offset = -5;
// Whether Daylight Savings (Summer Time) is Enabled.
// Also from configuration settings.
$daylight_savings = false;
// The stored server time timestamp fetched from database
$server_timestamp = time();
// Localized timestamp (server time with offset applied)
$local_timestamp = ($server_timestamp + ($timezone_offset * 3600));
// Account for Daylight savings.
$local_timestamp += ($daylight_savings) ? 3600 : 0;
// Get a localized date string.
$local_date_string = gmdate('r', $local_timestamp);
echo $local_date_string;Is there any real difference?