How do I override the ShortTimePattern
and LongTimePattern
to always be in 12 hour time?
The following code works well only with en-US, because other cultures have different patterns.
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongTimePattern = "h:mm:ss tt"
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortTimePattern = "h:mm tt"