Reputation: 684
I have this: "2013-02-23 18:06:00 UTC"
and need this: "2013-02-23T18:06:00Z"
to conform to this: http://books.xmlschemata.org/relaxng/ch19-77049.html
Does anyone know of a good library/tool/method in Ruby to do this without having to write some transformation method?
Upvotes: 1
Views: 1254
Reputation: 2046
Within Rails:
DateTime.now.utc.strftime()
=> "2012-08-22T17:55:12+00:00"
Upvotes: 2
Reputation: 9691
Check out the rubydocs for Datetime
here. There's a method to convert into ISO8601.
Upvotes: 2