All,
How can I convert to a unix timestamp to date and time in local timezone. For timestamp = 1303374724716, the date ('r', $timestamp) function of PHP gives me Sun, 16 May 2032 22:11:37 +0000 whereas the epoch converter CORRECTLY converts to
GMT: Thu, 21 Apr 2011 08:32:04 GMT
Your timezone: Thu Apr 21 2011 04:32:04 GMT-0400 (Eastern Daylight Time)
I have seen the php.ini file and the default timezone is UTC. I don’t understand why the value doesn’t even match the GMT/UTC time. Can anyone please help me convert to my local timezone i.e. New_York.
That is because the timestamp you are given is in milliseconds.
Do:
And everything will work as expected.