Since I am setting hour to 12, I was expecting it to be 12:00 AM. Also
t2 is Sat Mar 10 12:00:00.
I think 12:00:00 should translate to 12:AM and not to 12:00 PM.
I am using ruby 1.8.5 and rails 1.2.2
Any thoughts.
Even though technically it's incorrect (noon is "12 M" -- it's neither
anti or post meridian, it is the meridian), by convention midnight is 12
AM and noon is 12 PM, and that rule is codified in the ANSI C strftime
function.
--
Michael Wang
>> Time.now.change(:hour => 0, :min => 0, :sec => 0).strftime("%I:%M %p")
=> "12:00 AM"
> Since I am setting hour to 12, I was expecting it to be 12:00 AM. Also
> t2 is Sat Mar 10 12:00:00.
>
> I think 12:00:00 should translate to 12:AM and not to 12:00 PM.
You're fighting an uphill battle then, trying to change how the 12
hour clock is designed: Noon == "12 pm". Midnight == "12 am". http://
en.wikipedia.org/wiki/12-hour_clock has more information.
--
Jakob Skjerning - http://mentalized.net