php有效的时间戳典型范围是格林威治时间 1901 年 12 月 13 日 20:45:54 到 2038 年 1 月 19 日 03:14:07。(此范围符合 32 位有符号整数的最小值和最大值)。不过在 php 5.1 之前此范围在某些系统(如 windows)中限制为从 1970 年 1 月 1 日到 2038 年 1 月 19 日。
64位系统就不会受影响了,如果在32系统可以使用new DateTime解决
$date = '2090-10-01';$datetime = new DateTime($date);echo '<p>正常时间: ', $datetime->format('Y-m-d H:i'), '</p>';echo '<p>时间溢出: ', date('Y-m-d H:i', strtotime($date)), '<p>';相关:http://bbs.csdn.net/topics/390879876
立即学习“PHP免费学习笔记(深入)”;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号