getTimestamp("> 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?-PHP Chinese Network Q&A
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?
andrew_阿雄
andrew_阿雄 2023-07-29 17:15:28
0
0
171

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_阿雄

reply all (0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!