I need to determine if the current culture/locale is set to use am/pm time or 24-hour time.
At first I thought I could do this:
bool time24Hour = Thread.CurrentThread.CurrentCulture.DateTimeFormat.AMDesignator == "";
But then I read the comments on the last answer on this thread Get just the hour of day from DateTime using either 12 or 24 hour format as defined by the current culture which seems to imply this won't work.
I guess I could format an arbitrary time, and then analyze the results, but surely there's a simplier way?
EDIT:
See also my comment below - I just want to determine which one of two pre-formatted constant strings containing lists of hours I should select, and hope to avoid a lot of unnecessary contortions - I just need a yes/no answer as to whether this is an am/pm culture or a 24-hour culture.
The program is a WinForms program, if that is of any help.