为什么 getdate(1500000000) returns 2017 年 7 月 7 日而 getdate(2500000000) returns 1913 年 2 月 13 日

Why getdate(1500000000) returns July 7 2017 while getdate(2500000000) returns February 13 1913

问题很简单,这是一个错误还是我在这里遗漏了什么,事实是 getdate returns 的值更大,日期更早。怎么了??

2500000000 = 0x9502F900 = 1001 0101 0000 0010 1111 1001 0000 0000

即在 32 位系统上,符号位已设置,因此您实际上得到了一个负数。由于宇宙始于 1970 年(根据 unix),1913 年的日期是负时间戳的明显症状。

2,500,000,000 超过了 32 位整数的最大值。

我事先不知道答案。这些是我用来解决这个问题的资源: http://php.net/manual/en/language.types.integer.php
INT max size for 32bit system