![]() |
|
|
|
#1 |
|
I have some questions about datetime formatting....In our web app I have the
following in the web.config <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" Based on 3:00 pm time Now whenever I use DateTime.toShortTimeString I get "3:00 P.M" but what I really want is "15:00". Do I have to use DateTime.toString("HH:MM")? If I "hard code" that in my app how will that affect things if my culture changes to say German? (or is military time universal?) What other things should I be doing to ensure that our app can be "globalized"? thanks Doug -- Doug Swanson Senior Applications Developer Synchrono, Inc 651.228.1772 Doug Swanson |
|
|
|
|
#2 |
|
Posts: n/a
|
Hi,
1) Generally it's good practice to format your data and time to your chosen format and not to relay on the machine settings. Remember that any user / administrator can change formats. 2) If you will "hard code" date/time formats it want effects culture settings: string date = dt.ToString("D"); produce English string or Hebrew string depends on culture settings. blog : http://weblogs.asp.net/ngur Mobile: +972-(0)58-888377 *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Natty Gur |
|
![]() |
| Thread Tools | Search this Thread |
|
|