PHP time common method

<?php

date_default_timezone_set('PRC'); //默认时区

echo "今天:",date("Y-m-d",time()),"<br>";

echo "今天:",date("Y-m-d",strtotime("18 june 2008")),"<br>";

echo "昨天:",date("Y-m-d",strtotime("-1 day")), "<br>";

echo "明天:",date("Y-m-d",strtotime("+1 day")), "<br>";

echo "一周后:",date("Y-m-d",strtotime("+1 week")), "<br>";

echo"After four hours and two days one week two seconds:", DATE ( "Ymd G: H: S", strtotime ( "+ 1'd Week 2. 4 hours 2 seconds The Days")), "<br>" ; 

echo "next Thursday: ", DATE (" Ymd ", strtotime (" the Next catalog on Thursday "))," <br> " ; 

echo " last Monday:. " DATE (" Ymd ", strtotime (" Last catalog on Monday "))." < br> " ; 

echo .": "A month ago DATE (" Ymd ", strtotime (" Last month the. "))" <br> " ; 

echo " after one month:. " DATE (" Ymd ",strtotime("+1 month"))."<br>";

echo "十年后:".date("Y-m-d",strtotime("+10 year"))."<br>";



echo (strtotime('2020-5-20′)-strtotime(date(“Y-m-d”)))/86400;

?>

 

Guess you like

Origin www.cnblogs.com/espcms/p/10953028.html