Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

ISO 8601 date format for microformats (See related posts)

Used this in Ruby 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')


How to use:

<abbr class="dtstart" title="<%= event.start_date.strftime('%Y-%m-%dT%H:%M:%S%z') %>"><%= event.start_date.to_s(:long) %></abbr>

You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts