Is there a full implementation for ISO-8601 date parsing for Ruby?

Yes, but unfortunately it's in Ruby 1.9.

require "date"

Date.iso8601("2010-W32-5").strftime
#=> "2010-08-13" 

I don't believe there are any implementations for Ruby 1.8.7 (or at least I couldn't find any). You could either try to upgrade to Ruby 1.9, which is pretty stable as of 1.9.2. Alternatively, you could try to parse the dates yourself.


To convert an ISO8601 date into the local time zone, do this:

require "time"
dt1 = Time.parse("2010-09-06T12:27:00.10-05:00")

To convert an ISO8601 date into UTC, do this:

dt2 = Time.iso8601("2010-09-06T12:27:00.10-05:00")

If you compare the dates returned by the above queries, they will be identical (i.e. dt1 === dt2). However, accessing date components (like year, month, day, hour, etc.) will return values appropriate for the time zone (either UTC or local). The same applies to strftime.