Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long the time function works in php

Tags:

php

timestamp

Is php date() and time() function works between the years 1901-2038. What function will I use for my long based projects. or I am wrong?

like image 637
sathish Avatar asked Aug 16 '26 16:08

sathish


1 Answers

The timestamp only wraps around after January 19, 2038 on 32-bit systems. On 64-bit systems, this is not an issue, since most 64-bit operating systems use signed 64-bit integers for storing the timestamp. (With signed 64-bit integers, the timestamp wraps around on December 4, 292,277,026,596 AD.)

By 2038, I'd bet that most computer systems will be running on 64-bit architecture (at least), so it probably won't be a problem in the long run. Besides, there's nothing you yourself can do about it—it's an issue with the underlying operating system and processor architecture, not the code you write.

like image 198
hbw Avatar answered Aug 19 '26 09:08

hbw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!