<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: strftime code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 21 Aug 2008 15:57:44 GMT</pubDate>
    <description>DZone Snippets: strftime code</description>
    <item>
      <title>ISO 8601 date format for microformats</title>
      <link>http://snippets.dzone.com/posts/show/5364</link>
      <description>Strftime to get the ISO 8601 (see RFC 3339) full date format for an hEvent Microformat. Doubtless usable in other situations.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;strftime('%Y-%m-%dT%H:%M:%S%z');&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you're in Ruby, you can access this the quick way with:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ irb&lt;br /&gt;&gt;&gt; require 'time'&lt;br /&gt;=&gt; true&lt;br /&gt;&gt;&gt; Time.now.iso8601&lt;br /&gt;=&gt; "2008-07-09T16:13:30+12:00"&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Rails example:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;abbr class="dtstart" title="&lt;%= event.start_date.iso8601"&gt;&lt;%= event.start_date.to_s(:long) %&gt;&lt;/abbr&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 15 Apr 2008 05:03:22 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5364</guid>
      <author>Aupajo (Pete)</author>
    </item>
  </channel>
</rss>
