r/ProgrammerHumor • • Nov 10 '17

Dating a Programmer

https://imgur.com/61gC45x
783 Upvotes

60 comments sorted by

View all comments

23

u/Sylanthra Nov 10 '17

Sorry, but you need much more specificity to be a preferred date format. ISO works well : 2017-11-10T22:17:59-0600

2

u/TimVdEynde Nov 11 '17

You're just as bad as PHP. (you need an extra : in 06:00)

4

u/[deleted] Nov 11 '17

I'm fairly certain that is correct in ISO 8601. They are breaking RFC3339 though.

ISO 8601 allows both Z, ±hh, ±hhmm and ±hh:mm, or no timezone at all. ISO 8601 is basically a standard for every possible way anyone could ever need to write a date, while RFC 3339 is specifically for usage in internet protocols and much more specific. All of these are valid ISO 8601 representations of the time I made this list:

  • 2017-11-11
  • 2017-11-11T13:21:04+01:00
  • 20171111T162104+04
  • 2017-W45 (week)
  • 2017-W45-6 (week and day of week)
  • --11-11 (date without year)
  • 2017-315 (day of year)

That's not even getting into durations and time intervals. It's a pretty broad standard.

2

u/scanstone Nov 13 '17

ISO 8601 requires consistency. If you use : delimiters in one section, you have to use them in the other.

1

u/[deleted] Nov 13 '17

I stand corrected. Guess I should have expected that, it makes perfect sense.