|
<? PHP
Echo "Today:". date ("Y-m-d"). "<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> ";
The strtotime () function resolves the description of a date and time to a Unix timestamp.
IntStrtotime(String time [, int now])
?>
This function is expected to accept a string that contains a date format in American English and try to parse it into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT). Its value is relativenowThe time specified by the parameter. If this parameter is not provided, the current system time is used. |