Name

strptime

Synopsis

array strptime(string date, string format)

Parses a time and date according to the format string and the current locale. The format uses the same format as strftime(). Returns an associative array with information about the parsed time containing the following elements:

tm_sec

Seconds

tm_min

Minutes

tm_hour

Hours

tm_mday

Day of the month

tm_wday

Numeric day of the week (Sunday is 0)

tm_mon

Month

tm_year

Year

tm_yday

Day of the year

unparsed

The portion of date that was not parsed according to the given format

Get Programming PHP, 3rd Edition 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.