Last post Jan 24, 2011 02:40 PM by panpawel
Jan 21, 2011 02:08 AM|m.yazdian|LINK
I have a fantastic problem with asp.net datetime...!!!
My computer OS has windows server 2003 sp2. All Languages and Time configration in regional and language options set to united states but when I call asp.net datetime in my web page I get this string ( 2011/1/20 12:11:22 ب.ظ ).
ب.ظ has a farsi date and time format but I datetime format in regional options has English (United States)
This problem verry important for me becusse when I post datetime to sqlserver database (Datatype: datetime) I getting an error insert nvarchar to datetime...!!!???
IF any of my friend can help me, please answer to this question.
Jan 21, 2011 03:54 AM|sam_xiii|LINK
in you web.config file, did you set the culture ?
<globalization culture="en-US" />
http://www.sambeauvois.be | @sambeauvois
Jan 21, 2011 09:46 AM|sachingusain|LINK
Are you setting current thread's UI culture/ current culture anywhere?
Jan 24, 2011 02:40 PM|panpawel|LINK
Check the current culture of the processing thread:
It is usually set to the top-most language defined in the browser and passed to the server using in HTTP Header: Accept-Language.
You can change it by assigning in Page_Load:
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
Or as the first answer specifies, in Web.config.
Globalization and Localization