I'm attempting to format dates for a French customer.
I need to format Times as shown in the following examples...
06:00 -> 6 h
08:45 -> 8 h 45
10:30 -> 10 h 30
15:00 -> 15 h
17:22 -> 17 h 22
18:00 -> 18 h
I've been able to use Custom Date and Time Formatting. But I seem to be stuck on this notation that the French (Canadian at least) don't show the Minutes if they are zero "00".
Currently I'm using the following format.
myDateTime.ToString("H \h mm")
How can I make it so "mm" only appears when > 00?
I'd like to avoid the use of an extension method of proxy class since I feel this should be built into the framework. Apparently its standard formatting for French times.
My string "H \h mm" is actually coming from a resource file. ie...
myDateTime.ToString(Resources.Strings.CustomTimeFormat);
Thanks!