Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong in this picture?
Message
From
13/01/2008 12:24:38
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/01/2008 11:15:01
General information
Forum:
Windows
Category:
Computing in general
Miscellaneous
Thread ID:
01281294
Message ID:
01281472
Views:
7
>> ... wrote my own routine to convert from 24hr to am/pm. The logic is not only non-trivial, it actually isn't logical ;).
>
>It seems pretty trivial to me ... if you first convert the hour portion of a time string to a number. Subtract 12 from anything > 12, then put it back in the time string.

Actually, not quite. Subtract 12 from anything >=13. Up to 12:59 you still don't subtract, but AM is only until 11:59. So you subtract for times on or after 13:00, but it's PM for anything on or after 12:00.

My trouble actually came from what Latin I still remember. I didn't learn the AM/PM stuff at school (we learned 24hr, and the 2x12 was just what we used at home, no hard rules there, and no Latin involved, just rules-of-thumb), so I tried to use logic. "Ante" means "before", "post" means "after". Of course I got the noon wrong, and the time between 12:01 and 12:59 as well (now I can't understand how did I manage to do that wrong, but just goes to show how I get confused when there are more rules than logic :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform