<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean&#039;s Blog &#187; formatting</title>
	<atom:link href="http://seanbehan.com/tag/formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Custom Date Formats for Your Rails Application</title>
		<link>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/</link>
		<comments>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/#comments</comments>
		<pubDate>Wed, 13 May 2009 16:16:13 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=230</guid>
		<description><![CDATA[If you use a consistent date format often in your Rails applciation, it is worth it to add the format to your application environment. You can do this by adding  it to the bottom of the config/environment.rb file. Time::DATE_FORMATS[:my_custom_format] = &#34;%A %B %d, %Y&#34; Now you can use it in your views like this @post.created_at.to_s(:my_custom_format) [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby-on-rails%2Fcustom-date-formats-for-your-rails-application%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Custom Date Formats for Your Rails Application" data-url="http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>If you use a consistent date format often in your Rails applciation, it is worth it to add the format to your application environment. You can do this by adding  it to the bottom of the config/environment.rb file.</p>
<pre class="wp-code-highlight prettyprint">
Time::DATE_FORMATS[:my_custom_format] = &quot;%A %B %d, %Y&quot;
</pre>
<p>Now you can use it in your views like this</p>
<pre class="wp-code-highlight prettyprint">
@post.created_at.to_s(:my_custom_format)
</pre>
<p>Which will output something like Monday May 5, 2009</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/custom-date-formats-for-your-rails-application/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

