试图解析 1942 年 5 月 5 日
-872726549
DatTime::__construct()
Failed to parse time string (-872726549) at position 7 (4):
Unexpected character
1 1 1970 之前的所有日期都相同
1969年12月31日有同样的错误
我在 windows 上使用 xampp,php 5.4
这会触发错误:
$topv=-872726549;
$compared_time=new DateTime($topv);
最佳答案
根据文档,您应该这样做:
$topv='1930-08-09';
$compared_time=new DateTime($topv);
关于php - 带负时间戳的 datetime php fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15533781/