Copy codeThe Code is as follows:
<? Php
Date_default_timezone_set ('prc'); // Default Time Zone
Echo "Today:", date ("Y-m-d", time (), "<br> ";
Echo "Today:", date ("Y-m-d", strtotime ("18 June 2008"), "<br> ";
Echo "yesterday:", date ("Y-m-d", strtotime ("-1 day"), "<br> ";
Echo "Tomorrow:", date ("Y-m-d", strtotime ("+ 1 day"), "<br> ";
Echo "one week later:", date ("Y-m-d", strtotime ("+ 1 week"), "<br> ";
Echo "one week, two days, four hours, two seconds later:", date ("Y-m-d G: H: s ", strtotime ("+ 1 week 2 days 4 hours 2 seconds"), "<br> ";
Echo "next Thursday:", date ("Y-m-d", strtotime ("next Thursday"), "<br> ";
Echo "last Monday:". date ("Y-m-d", strtotime ("last Monday"). "<br> ";
Echo "a month ago:". date ("Y-m-d", strtotime ("last month"). "<br> ";
Echo "One month later:". date ("Y-m-d", strtotime ("+ 1 month"). "<br> ";
Echo "10 years later:". date ("Y-m-d", strtotime ("+ 10 year"). "<br> ";
?>
Php determines the number of days before a date.
Copy codeThe Code is as follows:
<? Php
Echo (strtotime ('1970-5-20 ')-strtotime (date ("Y-m-d")/2020; then
?>