strftime formatting with Ruby/Rails -- Lowercase am/pm

AnApprentice picture AnApprentice · Dec 19, 2010 · Viewed 8.5k times · Source

I have the following:

@comment.created_at.strftime("%I:%M %p %b %d")

Which outputs: 10:32 AM Dec 19

I'd like to output a lowercase am, like: 10:32am Dec 19

Any ideas on how to do that with ruby/rails?

thanks

Answer

DANDYYeah picture DANDYYeah · Apr 22, 2013

Try to use %P instead using %p