1

I'm aware of the year 2038 problem in PHP because of the 32bit limitation of integer values. I know that i need a 64bit system to make it working. Well, i've done so, i installed Apache 2.4.12 Win64 and PHP Version 5.6.6RC1 - Thread Safe 64bit for windows. I'm also on windows 7 64bit. And my problem is, strtotime still cannot handle dates higher than year 2038. Maybe there's a struggle in my head but i can't find the problem. I asking explicitly for strtotime, i know the solution of DateTime which is working, but i have old projects that uses lot of strtotime. Also i cannot get rid of the windows platform, it's just so here in our company :(

var_dump(strtotime("2038-11-01"));
// output: bool(false)

Edit1: I've tested php 7.0.0dev and here it works. Seems like i must wait for PHP7 to get proper 64bit on Windows. Luckily, 7.0.0dev seems right now pretty stable for me.

Edit2: With PHP7 the problem doesn't exist anymore. It is not recommended anymore to use any 5.x branch.

Here is my phpinfo output enter image description here

Brain Foo Long
  • 2,057
  • 23
  • 28
  • possible duplicate of [Accessing dates in PHP beyond 2038](http://stackoverflow.com/questions/5319710/accessing-dates-in-php-beyond-2038) – Rizier123 Feb 18 '15 at 09:48
  • @Rizier123 It's not a duplicate because i already use a 64bit system as suggested in this topic. Also i want to know why strotime is not working, DateTime is not alternative for me here. – Brain Foo Long Feb 18 '15 at 10:03
  • Did you read all answers in the possible duplicate?! Even the last one? Your problem is the second tag in your question – Rizier123 Feb 18 '15 at 10:04
  • 1
    Hm, yes right now i've seen it but that not answer the question why this not work in windows. It just says it's not working here, but why, i don't know. – Brain Foo Long Feb 18 '15 at 10:10

1 Answers1

0

Please try the latest master snapshot, to grab here http://windows.php.net/downloads/snaps/master/ . Generally - it doesn't matter whether your windows is 64-bit itself. With PHP5 the underlying API is 32-bit for many things including time and integers. PHP7 (the master builds I've linked) have true 64-bit support.

Thanks.

Anatol Belski
  • 660
  • 6
  • 8