Thursday, August 18, 2011

PHP date bug | date ends at 2037

While developing an application having backend in PHP ,when I tried to go past the year 2037 the system jumped back to 1970!
This is a known bug in PHP and is a limitation in counter that is 32 bits long,64bit machines are not vulnerable to this.

As per forum

The last date/time that is working:
19.01.2038 03:14:07 ( =2147480047 )

The workaround for this issue is to have 64 bit machine/OS, if you are running any unix based machines. Also make sure that the time_t is set to 64bit !

Hope this helps... and save your time.

No comments:

Post a Comment