time formatting (from Ryan Bates’ screencasts)

# in views

<%= post.created_at.to_s(:my_cool_format) %>

# in environment.rb (or any rb file under 'config/initializers' if using rails 2.0)

Time::DATE_FORMATS[:my_cool_format] = "due at %B %d on %I:%M %p"


Leave a Reply

Formatting: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>