DateTime formatting localization different on development and production

Topics: General, Troubleshooting
Aug 29, 2013 at 11:44 PM
In my development environment, DateTime localization (both conversion to string and parsing from string) follows the en-AU localization -- dd/MM/yyyy.

However, on production, the localization is en-US -- MM/dd/yyyy. So when I post dates back in 'dd/MM/yyyy' format I get validation errors like so: 'The value '28/8/2013' is not valid for StartDate'.

I discovered that on production, windows server was set to English (United States), so I changed all the settings to be English (Australia). However, still it is using the en-US localization.

I've also tried changing the default site culture in settings from en-US to en-AU to no avail.

I'm using Orchard 1.6. I would appreciate any help to figure out why this is happening!

Thanks!
Developer
Aug 30, 2013 at 12:56 AM
What you could do is set the culture (and maybe even uiCulture) attribute in web.config to en-AU (on the globalization element).
Aug 30, 2013 at 1:08 AM
I tried googling to find how to set that in Web.config but I couldn't find anything. Not sure what you mean about the globalization element.

Thanks
Developer
Aug 30, 2013 at 1:29 AM
Like this:
<system.web>
    <globalization culture="en-AU" uiCulture="en-AU"/>
...
</system.web>
http://msdn.microsoft.com/en-us/library/hy4kkhe0(v=vs.85).aspx
Aug 30, 2013 at 2:49 AM
Thankyou so much! That worked :)