CultureInfo UseUserOverride short time format not available W2K

  • Thread starter Thread starter colin_young
  • Start date Start date
C

colin_young

I am created a WinForms app on Windows 2000 and I would like to format
the time using the custom format string I have specified in the control
panel. I have the machine set to English (United States) and the time
format is HH:mm:ss. I'd like to use a short time format string (e.g. no
seconds), but the control panel doesn't allow me to set one.

Is there a work-around for W2K?

Thanks

Colin
 
From: (e-mail address removed)
|
| I am created a WinForms app on Windows 2000 and I would like to format
| the time using the custom format string I have specified in the control
| panel. I have the machine set to English (United States) and the time
| format is HH:mm:ss. I'd like to use a short time format string (e.g. no
| seconds), but the control panel doesn't allow me to set one.
|
| Is there a work-around for W2K?
|

You can use DateTime.ToString("t") to write the short time string. (Formats
"f" and "g" also use the short time format along with the date.)
If you need to set the short time format, you can set
DateTimeFormatInfo.ShortTimePattern and call DateTime.ToString with that
DateTimeFormatInfo as the format provider.

Katy
 
Back
Top