我需要得到PHP中的时间戳第二天18:00 CST如何获得PHP时间明天下午6点CST?
$tomorrow = mktime(18, 0, 0, date("m"), date("d")+1, date("y"));
echo "Tomorrow is ".date("Y-m-d H:m:s ", $tomorrow);
我无法设置分钟部分上面的代码,它总是在几分钟部分返回11。
Tomorrow is 2009-11-06 18:11:00
我需要得到PHP中的时间戳第二天18:00 CST如何获得PHP时间明天下午6点CST?
$tomorrow = mktime(18, 0, 0, date("m"), date("d")+1, date("y"));
echo "Tomorrow is ".date("Y-m-d H:m:s ", $tomorrow);
我无法设置分钟部分上面的代码,它总是在几分钟部分返回11。
Tomorrow is 2009-11-06 18:11:00
一个更简单的版本是使用strtotime()
:
echo "Tomorrow is ".date("Y-m-d H:i:s ", strtotime("Tomorrow 6pm"));
包括校正分钟(从米至i)。输出:
Tomorrow is 2009-11-06 18:00:00
这是伟大的! – 2009-11-05 06:45:53
Apache的版本:2.2.11 PHP版本:5.2.11 – 2009-11-05 06:33:43