PHPstrtotime () function PHP Date/Time function
Definition and usage
The strtotime () function parses the date and time descriptions of any English text into Unix timestamps.
Syntax
strtotime(time,now)
Parameter description
| Time |
Specifies the time string to be parsed. |
| Now |
The timestamp used to calculate the return value. If this parameter is omitted, the current time is used. |
Description
This function is expected to accept a string that contains the American English date format and try to parse it into a Unix timestamp (seconds since January 1 1970 00:00:00 GMT ), the value is relative to the time given by the now parameter. If this parameter is not provided, the current time of the system is used.
This function uses the TZ environment variable (if any) to calculate the timestamp. Since PHP 5.1.0, it is easier to define the time zone for all date/time functions. This process is described on the date_default_timezone_get () function page.
Return value
If the call succeeds, the timestamp is returned. otherwise, FALSE is returned. Before PHP 5.1.0, this function returns-1 if it fails.
Example
Output:
1138614504112829040011386325041139219304113950370911391804001138489200
PHP Date/Time function