strtotime

int strtotime(string timestring, [int timestamp]) 
timestring Time string to be converted
timestamp Optional timestamp to use instead of the current time

Converts a string representation of a date or time to a UNIX timestamp.

Returns:

UNIX timestamp; FALSE on failure

Description:

strtotime() is capable of taking a string containing a date or time specification in a variety of nearly natural-language formats and converting it into a simple UNIX timestamp. The string given may be very naturally expressed, using a combination of digits and any of the following strings. These strings may be pluralized with an appended s if appropriate, and are not case-sensitive. These strings are not localized, and must be used in English.

Unless ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.