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:00ZPHP - 这是为什么日期函数不示数出
为什么?应该这个错误?
谢谢,这就是我一直在寻找 – 2010-04-20 19:21:05