Reputation: 266940
In Rails, how to display date like NOV 22, '09?
And time like: 5:10 PM
Upvotes: 1
Views: 239
Reputation: 11038
Check out the section 3.2, "Adding Date and Time Formats", in th Internationalization Rails Guide. You'll declare the format in a locales file using (I believe):
# config/locales/custom.yml
custom:
time:
formats:
short: "%b %d, '%y"
and call it in your view with:
<p><%= l Time.now, :format => :short %></p>
Upvotes: 4