我的服务器时间目前是:
Sunday 15 December 11:18:00 EST 2013
给出以下脚本:
date_default_timezone_set("Australia/ACT");
$date1 = date('D, Y-m-d H:i:s', strtotime("+1 Weekday"));
$date2 = date('D, Y-m-d H:i:s', strtotime("+2 Weekdays"));
$date3 = date('D, Y-m-d H:i:s', strtotime("+3 Weekdays"));
$date4 = date('D, Y-m-d H:i:s', strtotime("+4 Weekdays"));
$date5 = date('D, Y-m-d H:i:s', strtotime("+5 Weekdays"));
$date6 = date('D, Y-m-d H:i:s', strtotime("+6 Weekdays"));
echo "+1 Weekday: " .$date1 . "<br>";
echo "+2 Weekday: " .$date2 . "<br>";
echo "+3 Weekday: " .$date3 . "<br>";
echo "+4 Weekday: " .$date4 . "<br>";
echo "+5 Weekday: " .$date5 . "<br>";
echo "+6 Weekday: " .$date6 . "<br>";
什么会导致日期5到6周日返回? 不是工作日。
+5 Weekday: Sun, 2013-12-22 00:00:00
+6 Weekday: Mon, 2013-12-23 00:00:00
我期待+5平日回归星期五,2013-12-20。
我在Debian上运行PHP 5.4.17-1,默认时区设置为澳大利亚/悉尼。