I think I'm going nuts as this has to be simple.
The time on my computer is currently: 14:41 When I run any of the code below, it returns: 13:41.
$date = new DateTime();
$date->format('Y-m-d H:i:s') //13:41
date('Y-m-d H:i:s') //13:41
date_default_timezone_get()
returns UTC.
Now I understand why it's an hour behind (because we are in daylight saving time) BUT isn't there a function that takes all this into account and returns the actual time?
p.s I am expecting to have missed something obvious here.
Edit: date('Y-m-d H:i:s -- I -- e');
returns 2013-09-13 14:15:47 -- 0 -- UTC
. Shouldn't the I
param be return 1?