且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么时间戳限制为2038?

更新时间:2023-01-19 22:03:45

限制是由大多数C库用来表示该计数的4字节带符号整数强加的.快速数学(假设365天年,并非完全正确):

The limit is imposed by the 4 byte signed integers that most C libraries use for representing that count. Quick math (assumes 365 day years, not exactly correct):

2147483648 seconds ~ 68.1 years

这也意味着下限约为1900.一些库已开始引入64位纪元计数,但目前它们之间相距甚远.

This also implies a lower limit of ~1900. Some libraries have started to introduce 64 bit epoch counts, but they are few and far between for the moment.