<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: date code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 29 Aug 2008 00:47:45 GMT</pubDate>
    <description>DZone Snippets: date code</description>
    <item>
      <title>Formatting a date with or without the time</title>
      <link>http://snippets.dzone.com/posts/show/3168</link>
      <description>Ruby on Rails&lt;br /&gt;&lt;br /&gt;This helper returns the date (and possibly the time) formatted the way you want&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;def format_date(date, use_time = false)&lt;br /&gt;    if use_time == true&lt;br /&gt;        ampm = date.strftime("%p").downcase&lt;br /&gt;        new_date = date.strftime("%B %d, %Y at %I:%M" + ampm)&lt;br /&gt;    else&lt;br /&gt;        new_date = date.strftime("%B %d, %Y")&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 19 Dec 2006 14:47:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3168</guid>
      <author>alexwilliams (Alex Williams)</author>
    </item>
  </channel>
</rss>
