从documentation for strtotime():
strtotime() has a range limit between Fri, 13 Dec 1901 20:45:54 GMT and Tue, 19 Jan 2038 03:14:07 GMT; although prior to PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on some operating systems (Windows).
您运行的是哪个版本的PHP?在什么平台上?也许现在是升级的时候了.
如果您正在处理1901年12月13日至2038年1月19日范围之外的日期,那么请考虑使用PHP的DateTime对象,这些对象可以使用更广泛的日期范围.
程序:
$date = date_create($row['value']);
if (!$date) {
$e = date_get_last_errors();
foreach ($e['errors'] as $error) {
echo "$error
";
}
exit(1);
}
echo date_format($date, "F j, Y");
OOP:
try {
$date = new DateTime($row['value']);
} catch (Exception $e) {
echo $e->getMessage();
exit(1);
}
echo $date->format("F j, Y");