Jump to content

strtotime different results on different servers!?


MontyMoose

Recommended Posts

Hello wize PHP dudes. I'm a fairly advanced PHP user, but I'm confused by STRTOTIME producing different results on two identical servers.

Both running PHP Version 5.2.6-3.

 

- Server 1: echo date("Y",strtotime('1763-03-24 00:00:00')); returns '1763'

- Server 2: echo date("Y",strtotime('1763-03-24 00:00:00')); returns '1970'

 

Why do you reckon Server 1 seems not to worry about the Unix Epoch date limit, and happily computes the 1763 date? I would really like Server 2 to do the same thing, but having gone through the php.ini I can't see any difference.

 

I would really like Server 2 to start working with older dates. I don't want a workaround, as server 1 has been working with just strtotime for years. I can't remember doing anything different on setup. Weird!

 

Thanks.

Found the problem but not an easy solution sadly. One of my servers is 64bit hence the longer timestamp range. The 32bit version of strtotime doesn't work for dates earlier than 1901. date_create() does work but most of my code will have to be rewritten by the sounds of things. :-(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.