Suppose this code:
<?php
date_default_timezone_set('UTC');
$time = gmmktime(14, 50, 0, 5, 12, 2013);
echo date('Y-m-d H:i:s O', $time).'<br />';
echo gmdate('Y-m-d H:i:s O', $time).'<br />';
date_default_timezone_set('GMT');
$time = gmmktime(14, 50, 0, 5, 12, 2013);
echo date('Y-m-d H:i:s O', $time).'<br />';
echo gmdate('Y-m-d H:i:s O', $time);
?>
On my local server I get the output:
2013-05-12 14:50:00 +0000
2013-05-12 14:50:00 +0000
2013-05-12 14:50:00 +0000
2013-05-12 14:50:00 +0000
But on production the same code produces:
2013-05-12 10:50:00 -0400
2013-05-12 14:50:00 +0000
2013-05-12 14:50:00 +0000
2013-05-12 14:50:00 +0000
Changing time of the machine doesn't affect the output in any way.
Some info:
$ date +%Z
GMT
$ date +%z
+0000
- PHP 5.3.25 (cli) (built: May 11 2013 09:54:00)
- CentOS release 5.9 (Final)