This function parses an English textual date or time into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT).

Syntax: strtotime(time,now)

Description:

The first argument “time” is Required. It specifies the time string to parse.

The second argument “now” is Optional. It specifies the timestamp used to calculate the returned value. If this parameter is omitted, current time is used.

Note: If the year is specified in a two-digit format, values between 0-69 are mapped to 2000-2069 and values between 70-100 are mapped to 1970-2000.

This function returns false on failure.

Example:
Code:

echo strtotime("now")."
"; echo strtotime("9 September 2011")."
"; echo strtotime("+1 day")."
"; echo strtotime("+1 week")."
"; echo strtotime("+1 week 2 days 4 hours 2 seconds")."
"; echo strtotime("next Thursday")."
"; echo strtotime("last Monday");

Output:

1302430839
1315526400
1302517240
1303035640
1303222842
1302739200
1301875200

eXTReMe Tracker