我遇到以下问题。
环境:PHP 7.0.8 代码示例:
and (
([Year] = '2014' and [Period] in('10','11','12')) or
[Year] = '2015' or
([Year] = '2016' and [Period] in('01','02','03','04','05','06','07','08')--,'09','10','11','12')
)
我希望,输出是相等的。但我得到了:
$timestamp = -122615337600;
$dt1 = new \DateTime();
$dt1->setTimestamp($timestamp);
$dateStr = $dt1->format('Y-m-d H:i:s');
echo 'DateTime1: ' . $dateStr . '<br>';
$dt2 = new \DateTime($dateStr);
$dateStr = $dt2->format('Y-m-d H:i:s');
echo 'DateTime2: ' . $dateStr . '<br>';
有人可以告诉我为什么会这样,我该如何解决? 乍一看,我会说,这是一个PHP错误?