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.

Link to comment
Share on other sites

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. :-(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.