Detect with javascript if user's machine is using 12 hour clock (am/pm) or 24 clock (military time)

Is it possible to detect if user’s machine is using 12 hour clock (am/pm) or 24 hour clock (military time)?

One way would be to check users locales, but then it is just massive list of locale comparison and someone from U.S who wants 12 hour clock can send me just en locale, not US_en and I have no way of knowing her preferences. At the same time someone from U.S might be set her machine to use 12 hour time format and doesn’t want 12 hour clock.



Would work it theory, as user Mouser suggested below, but unfortunately it’s bugged on WebKit browsers (tested on Chrome and new Opera on Windows) and for some reason always returns am/pm time.


So I guess I have to rephrase my question if anyone has an idea how to accomplish it on webkit browsers also.

110 thoughts on “Detect with javascript if user's machine is using 12 hour clock (am/pm) or 24 clock (military time)”

  1. Good day I am so thrilled I found your site, I really found you by error,
    while I was browsing on Google for something else, Anyways I am here now and would just like
    to say cheers for a fantastic post and a all round exciting blog (I also love
    the theme/design), I don’t have time to browse it all at the moment but I have saved it and also added your RSS feeds, so when I have
    time I will be back to read a lot more,
    Please do keep up the excellent work.

  2. Undeniably believe that which you said. Your favorite reason appeared to be on the net the easiest thing to be aware of.
    I say to you, I certainly get annoyed while people think about worries that they plainly do not know about.
    You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people could
    take a signal. Will probably be back to get more.



Leave a Comment