0

It's a simple question..but drive me 2 madness. the result of this simple line of code:

echo gmdate('Y/m/d H:i:s');

... must output GMT time but it get it minus 1 hour!!!!! So why??

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
Elsammak
  • 1,102
  • 10
  • 26

2 Answers2

1

Greenwich Mean Time has no "Summer Time" or "Daylight Saving Time" so depending on the season of the year these statements may produce the same or different output.

date_default_timezone_set('Europe/London'); 
echo gmdate('c'); 
echo date('c'); 

-- from the PHP manual (so, in addtion to the answer you get a clear RTM ;)

More information about timezones and daylight saving on SO.

Community
  • 1
  • 1
markus
  • 40,136
  • 23
  • 97
  • 142
0

Compare the output of your script with:

If it's wrong, the computer where you run the code is probably misconfigured.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360