小四行代码返回空值。
<?php
$date = "03-30-15";
$time = "13:00";
$zone = "America/Chicago";
echo "String to time is: " . strtotime("$date $time $zone");
?>
答案 0 :(得分:1)
strtotime
无法识别您传递的日期格式。需要采用Y-m-d
格式:
来自 Definition :
该函数需要一个包含英文日期格式的字符串
<?php
$date = "2015-03-30";
$time = "13:00";
$zone = "America/Chicago";
echo "String to time is: " . strtotime("$date $time $zone");
?>
<强> DEMO 强>