, ,

datetime-design-pattern in Ruby

I was looking for a way to express the datetime-design-pattern in Rails, which is a common datetime format for microformats such as hCalendar, hReview and hAtom. I found that Time#xmlschema does just that, but it seems to be a new addition to Ruby, because it doesn't work in irb 0.9.5.

>> Time.now.xmlschema
=> "2006-07-12T20:52:41-05:00"

Comments