Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually the article seems to be a bit confused:

> If you aren’t doing ordinal dates, you aren’t doing ISO 8601.

It seems ruby1.9 does implement ordinal dates just fine:

    irb(main):002:0> Date.iso8601("2012-012")
    => #<Date: 2012-01-12 ((2455939j,0s,0n),+0s,2299161j)>
    irb(main):005:0> Date.iso8601("2012-366")
    => #<Date: 2012-12-31 ((2456293j,0s,0n),+0s,2299161j)>
What it does not implement is the "YYYY-MM" format:

    irb(main):010:0> Date.iso8601("2012-12")
    => #<Date: 2012-01-12 ((2455939j,0s,0n),+0s,2299161j)>


Yeah, I wrote it in a bit of a hurry on the train. Will fix.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: