ISO 8601 Date Format For Microformats
Join the DZone community and get the full member experience.Join For Free
Strftime to get the ISO 8601 (see RFC 3339) full date format for an hEvent Microformat. Doubtless usable in other situations.
strftime('%Y-%m-%dT%H:%M:%S%z');If you're in Ruby, you can access this the quick way with:
$ irb >> require 'time' => true >> Time.now.iso8601 => "2008-07-09T16:13:30+12:00"Rails example:
<%= event.start_date.to_s(:long) %>
Opinions expressed by DZone contributors are their own.