views:

24

answers:

1

Since upgrading a website from ASP.NET 3.5 to ASP.NET 4.0 my dates come out in US format, ie 3/24/2010. How can I change it back to UK format (24/3/2010) for all pages on my site? Is there a default setting somewhere?

+1  A: 

Sorry, I've found the answer myself:

You add the following within system.web section in the web.config file.

<globalization culture="en-GB" uiCulture="en-GB" />

I can only presume that .NET 4 ignores the machines own settings now :( Or perhaps theres another place it's defined for .NET that's even higher than web.config?

Nick G
That would be machine.config - see http://msdn.microsoft.com/en-us/library/ms229697.aspx
Dan Diplo
Wonder why it doesn't honour the machines own default (as set through control panel) in .NET 4 - it always did before :(
Nick G