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
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
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