PHP Manual
This manual is provided as a courtesy. It is not an official source. Please check php.net for updated information.
(PHP 5 >= 5.1.0RC1)
strptime() returns an array with the date parsed, or FALSE on error.
Month and weekday names and other language dependent strings respect the current locale set with setlocale() (LC_TIME).
Note: This function is not implemented on Windows platforms.
The string to parse (e.g. returned from strftime())
The format used in date (e.g. the same as used in strftime()).
For more information about the format options, read the strftime() page.
Returns an array, or FALSE on failure.
Table 1. The following parameters are returned in the array
Example 1. strptime() example
<?php$format = '%d/%m/%Y %H:%M:%S';$strf = strftime($format);echo "$strf\n";print_r(strptime($strf, $format));?>
The above example will output something similar to:
03/10/2004 15:54:19 Array ( [tm_sec] => 19 [tm_min] => 54 [tm_hour] => 15 [tm_mday] => 3 [tm_mon] => 9 [tm_year] => 104 [tm_wday] => 0 [tm_yday] => 276 [unparsed] => )