PHP 5.6.0 released

Supported Date and Time Formats


This section describes all the different formats that the strtotime(), DateTime and date_create() parser understands. The formats are grouped by section. In most cases formats from different sections can be used in the same date/time string. For each of the supported formats, one or more examples are given, as well as a description for the format. Characters in single quotes in the formats are case-insensitive ('t' could be t or T), characters in double quotes are case-sensitive ("T" is only T).

add a note add a note

User Contributed Notes 1 note

11 months ago
I am afraid that there are some misleading expressions in this chapter "Supported Date and Time Formats".

(i) "MM & II" in "Time Formats" express "minutes & seconds" whereas "II & SS" often do the same in other places --- to avoid mistaking "M of minites" for "M of month".

(ii) The Format for "doy" in "Compound Formats" does not allow "000" shown in the Example.

(iii) "M / MM" in Table "Localized Notations" in "Compound Formats" are used for "month" whereas "MM" allows 00-59 according to the Table "Used Symbols".
To Top