10 ms·
Writing the Time: AM and PM or a.m. and p.m.?
- simne 5y agoI know Prime Minister. Who is is AM? :) If serious, I think the best 24h system.
- jleyank 5y agoa/p. Although 24 hours works as well but many are not so comfortable with that.
- esperent 5y agoTL;DR: write it however you like, just be consistent.
- wildrhythms 5y agoFor web developers: Please stop trying to force your 'preferred' style on users, and instead learn to embrace locale and language-sensitive methods like Javascript's Date.toLocaleString() https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- dexwiz 5y agoFor a more modern approach try the Intl.DateTimeFormat package. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- atoav 5y agoAs someone who prefers ISO-8601 I'd love if something would honor my LC_TIME="long-iso"
- lionkor 5y agolet me lovingly clown on a fellow 8601 enjoyer by saying P1Y2M10DT2H30M/2008-05-11T15:30:00Z
- testmasterflex 5y agoA question to people used to the 12-hour format. I’m working on a music player for bathrooms (https://Loodio.com https://Loodio.com) where a clock one of the main features. How annoying is the 24-hour format for you?
- ericpp 5y agoIt's indecipherable to most people in the U.S. who refer to it as "military time".
- waste_monk 5y ago... I understand the U.S. has a pretty woeful education system in some parts, but has it reached the point where converting 12 and 24h time is considered an advanced task that is beyond the reach of most people? I'm morbidly curious.
- artogahr 5y agoThis is from just yesterday: https://news.ycombinator.com/item?id=30992322 https://news.ycombinator.com/item?id=30992322
- KSPAtlas 5y agoif time.ampm == PM: return time.hour + 12 else: return time.hour
- testmasterflex 5y agoYou’re right. Stupid question. Easy fix.
- Akronymus 5y ago12:24 pm?
- ericpp 5y agoif time.hour == 12 && time.ampm == AM: return 0 elif time.hour == 12 && time.ampm == PM: return 12 elif time.ampm == PM: return time.hour+12 else: return time.hour
- KSPAtlas 5y ago24 hour personally, I'm not really a frontend person so I don't nerd to display it.