標籤:style blog color ar sp div on log 代碼
echo strtotime(date(‘Y-m-d‘)); 擷取明天淩晨的時間戳記代碼:echo strtotime(date(‘Y-m-d‘,strtotime(‘+1 day‘))); 附上測試代碼:echo strtotime(‘2012-11-2‘);echo strtotime(‘2012-11-2 00:00:00‘);echo strtotime(date(‘Y-m-d‘)),‘‘;echo date(‘Y-m-d H:i:s‘,strtotime(date(‘Y-m-d‘)));echo strtotime(date(‘Y-m-d‘,strtotime(‘+1 day‘)));echo ( strtotime(date(‘Y-m-d‘,strtotime(‘+1 day‘))) - strtotime(date(‘Y-m-d‘)) )/3600; 其它參考代碼: echo "一周后:".date("Y-m-d",strtotime("+1 week")); echo "一周零兩天四小時兩秒後:".date("Y-m-d G:H:s",strtotime("+1 week 2 days 4 hours 2 seconds")); echo "下個星期四:".date("Y-m-d",strtotime("next Thursday")); echo "上個周一:".date("Y-m-d",strtotime("last Monday")); echo "一個月前:".date("Y-m-d",strtotime("last month")); echo "一個月後:".date("Y-m-d",strtotime("+1 month")); echo "十年後:".date("Y-m-d",strtotime("+10 year"));
PHP 擷取當天 淩晨 時間戳記常用代碼