search

Home  >  Q&A  >  body text

In php, if the system time is set after 2038-01-19, the current time obtained is truncated to a negative number. How to solve it?

The system is a 64-bit operating system, PHP 7.3 is also 64-bit, PHP_INT_MAX is 9223372036854775807, date.timezone = "PRC"

After setting the system time to 2038-01-19, use time () The current time obtained is truncated to a negative number,

Use

$dateTime = new DateTime();

$timestamp = $dateTime->getTimestamp();

It’s also a negative number

Could you please tell me how to solve it?

I don’t want the application I made to be scrapped after 2038-01-19


andrew_阿雄andrew_阿雄488 days ago260

reply all(0)I'll reply

No reply
  • Cancelreply