I want a date time format which looks like this:- Tuesday, 27th December 2011 at 3:30 pm.
I made changed in the en.yml file to look like this
time:
format:
short_ref: "%A, %d %b at %I"
When I try to run the app I get this error : 18n::MissingTranslationData in Home#index
translation missing: en.time.formats.long
What might be causing this error?
Try using the
strftimefunction in ruby. That gives you a lot of flexibility in manipulating the date formats of ruby.You can also try something similar to this :
This will return the date in this format :
Learn more about the
strftimefunction in the Ruby API