我正在寻找有关我的PHP代码的帮助:
$date = date('m/d/Y h:i:s a', time());
echo "The current server timezone is: " . $date;
$jd=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y"));
echo(jddayofweek($jd,1));
当前,此输出:
The current server timezone is: 03/28/2014 01:27:17 pm Friday
我正在尝试使它显示当前月份,每月的某天以及当前时间加上十二小时。例如,输出为:
The current server timezone is: March 28 Friday at 1:27 am Friday
如果有人可以帮助,将不胜感激。感谢您的任何帮助。
在OOP风格中:
$dateTime = new DateTime('now');
$dateTime->add(new DateInterval('PT12H'));
echo $dateTime->format('F j l \a\\t h:i a l');
或仅使用DateTime:
$dateTime = new DateTime('+12 hours');
echo $dateTime->format('F j l \a\\t h:i a l');
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句