【发布时间】:2010-04-20 19:10:38
【问题描述】:
function convertDT($TS) {
$TS = strtotime($TS);
$TS -= date("Z");
$newTS = date("Y-m-d\TH:i:s\Z", $TS);
return $newTS;
}
echo "Good: ".convertDT('2010-04-20 01:23:45')."\n";
echo "Bad: ".convertDT('2010-31-20 01:23:45')."\n";
第二个日期返回:1969-12-31T23:00:00Z
为什么?应该是这个错误吗?
【问题讨论】: