What I want is..
If culture is en-US then
string dateFormat="MM/dd/yyyy";
string timeFormat="24.00 hrs";
If culture is en-GB then
string dateFormat="dd/mmyyyy";
string timeFormat="24.00 hrs";
and so on for other countries..
Now how do I get these date and time format values ? What are the standards? Like which all countries use similar date/time formats and which ones don't ?
ok I tried this :-
DateTime myDate = new DateTime();
string us = myDate.ToString(new CultureInfo("en-US"));
string us gets value =1/1/0001 12:00:00 AM
Now how do I extract "dd/mm/yyyy" and "24.00 hrs" out of this...in my Dateformat column in my Table... I want to store STRINGS such as dd/mm/yyyy or mm/dd/yyyy NOT dates..In my TimeFormat column in the table, the values to be stores are STRINGS too, like I need to store either "24:00hrs" or "12:00hrs"
How do I do this now ?
**using ShorTimePattern returns these values as
h:mm tt and HH:mm
If I want to store the values in my DB exactly as "24:00hrs" and "12:00hrs", how do I use these values..h:mm tt and HH:mm
which one is for 24 hr format and which for 12 hr format ?**
ok now there's another problem too...I want the information about Decimal Separator and Thousand Separator too based on the CultureInfo...whats the property for that ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…