Thursday, March 16, 2017

Gmdate() is always 10 minutes off actual GMT time

Something really weird is happening where the function gmtdate() returns the wrong time. It's always 10 minutes less.

$utc_str        = gmdate( 'd-m-Y:H-i', time() );
print("Time: " . $utc_str . "\n\n");

*Note: I am not comparing the gmdate to my time (that would have a timezone bias). I am comparing it to the GMT time (I just google gmt time and check that).

So examples of what I get is Time: 17-03-2017:00-19 when the actual time is 00-29. It's always 10 minutes off. Is this something to do with my PHP setup?

My PHP.ini file has date.timezone = UTC.



via Jake M

Advertisement