Strftime and AM/PM

Hi all

I am trying to format a mysql datetime attribute in my view.
I have tried strftime(%r) as well as strftime(’%I:%M:%p’)

In neither of the cases do I get the AM/PM parts.

Anyone have a clue/pointer?

thanks
Ivor

Add %p to the format string to get AM/PM, i.e.

Time.now.strftime("%p") yields either AM or PM :slight_smile:

Cheers,
James

Strange - I can see that it works in IRB, but its not working in my
rails console.

There must be something in legacy code that is overriding strftime.

thanks anyway.

Ivor