Question

I have made a foolish mistake...

I installed .Net before setting my regional settings in XP and now DateTime.Now will set the date as 12/01/2009 instead of 01/12/2009.

I'm sure there is an easy way to change this for the .Net runtime config but I can not remember what it is.

Help?

Was it helpful?

Solution 3

No neither of the above answers is correct.

The correct way to solve my problem was to amend the regional settings for my user account and then within the Registry export the Control Panel \ International key to a file. Then for each other user export the same key and overwrite the correct UK settings from the first (and correct reg key).

Once updated run each users settings back in to the registry and all is solved. The problem is to do with the regional settings applied to the ASPNET user created when installing DotNet.

OTHER TIPS

Change the Windows regional settings and it should be picked up automatically. At worst you might have to reboot. I don't believe the .NET-install-time regional settings are stored anywhere permanently.

For ASP.NET, I think you can use http://msdn.microsoft.com/en-us/library/bz9tc508.aspx

For WinForms and WPF application, I usually override Thread.CurrentThread.Culture and UICulture.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top