1

I decided to check the end of the unix epoch, so I change the date more than 2038 in my calendar. I surprized that the:

$now = new DateTime('now');    echo $now->format('Y-m-d');

RETURNS 1970-01-01 !

$now = new DateTime();

returns same and php 5.4 returns same. However:

$now = new DateTime('9000-10-01');

returns 9000-01-01. How to get current date after 2038 using DateTime?

My OS: winxp x32 and php 5.3/5.4 x86.

user3551026
  • 515
  • 5
  • 9

1 Answers1

1

"How to get current date after 2038 using DateTime?"

I'd consider using a fully 64 bit stack and OS. And by the way, the unix timestamp convention is not used only in unix/linux.

See php time function as a good example. This function cannot give a result for dates after 2038, if you use only 32 bits integers.

dotpush
  • 428
  • 3
  • 14