I can\'t seem to find this and I feel like it should be easy. In Ruby on Rails, how do I take:
2010-06-14 19:01:00 UTC
and turn it into
Needs the Time module for Time.parse and ActiveSupport for Integer#ordinalize:
Time.parse
Integer#ordinalize
require 'time' require 'active_support' input = '2010-06-14 19:01:00 UTC' t = Time.parse(input) date = "%s %s, %d" % [t.strftime("%B"), t.day.ordinalize, t.year] # => "June 14th, 2010"