Maximum time() | PHP

前端 未结 6 1360
半阙折子戏
半阙折子戏 2020-12-15 18:08

It\'s kind of a silly question, but what would be the maximum INT value of a time() and it\'s future date, e.g.

1st January 2999

6条回答
  •  一生所求
    2020-12-15 18:46

    On 64-bit platforms PHP_INT_MAX does not reflect maximum INT value for 32-bit platforms. Here's how to get it:

    $max32bitInt = PHP_INT_SIZE == 4 ? PHP_INT_MAX : PHP_INT_MAX>>32;
    

    If you're always using 64-bit platform, just use:

    PHP_INT_MAX>>32
    

提交回复
热议问题