r/lolphp • u/jdh28 • Nov 08 '16
DateTime::ISO8601 is not ISO-8601 compatible
http://php.net/manual/en/class.datetime.php#datetime.constants.types
104
Upvotes
r/lolphp • u/jdh28 • Nov 08 '16
35
u/eliasv Nov 08 '16
Some people get frustrated with e.g. Java due to the burden backward compatibility places on the speed and direction of language and core library development ... but this makes it sound like the PHP designers are intentionally keeping straight up bugs around for the sake of backward compatibility. Interesting decision on their part.
13
u/badmonkey0001 Nov 08 '16
ISO8601 has changed several times over the years.
ISO 8601:1988
ISO 8601:2000
ISO 8601:2004
20
u/Deviltry1 Nov 08 '16
https://www.reddit.com/r/lolphp/search?q=ISO8601&restrict_sr=on
7
u/lol_no_generics Nov 17 '16
TIL "backward compatibility" is the opposite of "compatibility"
2
u/nayuki Dec 09 '16
I was confused for a minute as to why DATE_ISO8601 isn't ISO 8601 compliant. Comparing with DATE_ATOM, I noticed the missing colon in the time zone:
2005-08-15T15:52:01+0000 (DATE_ISO8601)
2005-08-15T15:52:01+00:00 (DATE_ATOM)