Hi Julia,
That is odd. According to the .Net SDK regarding the return value of the
DateTime.ToShorTimeString method:
""The value of this instance is formatted using the short time format
character, 't'. The return value is identical to the value returned by
ToString ("t", null)."
This overload of the DateTime.ToString method takes 2 parameters, the second
of which is a System.Globalization.DateTimeFormatInfo instance. If it is
null, the DateTimeFormatInfo member of the static
System.GlobalizationCurrentCulture.CultureInfo property is used.
Again, according to the documentation, this Standard DateTime Format string
for the "en-us" culture specification is equivalent to the Custom DateTime
Format string "h:mm tt" (Hour 1-12, 2-digit Minute, and either "AM" or
"PM").
The CultureInfo.CurrentCulture class is documented as, when a managed
Application Thread starts, the Windows API GetUserDefaultLCID function is
called, which obtains the Local Identifier from the Operating System. This
Local Identifier is what you would set in Control Panel if you changed your
Regional Options.
The only possibility I can guess is that, since an ASP.Net application is
hosted in IIS, if you changed your Regional Options and did not either
restart IIS or reboot the computer, the ASP.Net application may not have
restarted, and fetched the new Local Identifier.
Here are some references that should help:
http://msdn2.microsoft.com/en-us/li...tion.datetimeformatinfo.shorttimepattern.aspx
http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_08tg.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_8sj7.asp
--
HTH,
Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com
Never trust a dunderhead with a blunderbuss.