Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
07-27-2004, 12:51 PM #1
- Join Date
- Jul 2004
- Thanked 0 Times in 0 Posts
asp.net control date localisation problem
I am building an ASP.NET server control in C#, and I need the control to convert a DateTime variable into a string, using the date format set by the user in Regional Settings. So far I have tried:
protected System.IFormatProvider format;
format = new CultureInfo(CultureInfo.CurrentCulture.Name,true);
...and then further down....
datestring = Convert.ToString(new DateTime(thisyear,thismonthnumber,day),format);
However it always seems to use the "en-GB" format even when I specify English-US in Control Panel's Regional Settings. Any ideas why this is happening?
Any advice would be much appreciated, cheers