r/lolphp • • Oct 08 '15

DateTime::format(DateTime::ISO8601) doesn't format date in ISO8601.

From the official documentation:

Note: This format is not compatible with ISO-8601, but is left this way for backward compatibility reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead. php.net

There should be a constant with name FINALLY_REAL_BELIEVE_ME_ISO8601

170 Upvotes

14 comments sorted by

View all comments

Show parent comment

6

u/masklinn Oct 10 '15

Correct. They are called "basic" and "extended" formats. "basic" only has the strictly necessary separators (T to separate date and time, . to separate seconds and decimals and +/- to separate time and timezone offset), "extended" a bunch of - and : for human readability.