In peacetime we often need to format the time of a string before using
In PHP, you can use the following methods:
$temp _date = ' 2011-01-09 19:25:43 ';
Date (' y-m-d ', Strtotime ($temp _date)); The output of this is 2011-01-09.
The function of Strtotime is to resolve the date-time description of any English text to a UNIX timestamp
The following is an official note:
int strtotime (string time [, int now])
This function expects to accept a string that contains the English date format and attempts to resolve it to a UNIX timestamp. The now parameter does not work if the time is in absolute times format.
If time is in a relative time format, it is provided by now, or the current time is not available if the?? Returns-1 when failed.
Programs are more robust, then we can determine if we can convert
It also needs to be explained that there is a time interval: December 13, 1901 Friday 20:45:54 to January 19, 2038 Tuesday 03:14:07