DateTime formatting localization different on development and production

Topics: General, Troubleshooting
Aug 29, 2013 at 10: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!

Aug 29, 2013 at 11:56 PM
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 12: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.

Aug 30, 2013 at 12:29 AM
Like this:
    <globalization culture="en-AU" uiCulture="en-AU"/>
Aug 30, 2013 at 1:49 AM
Thankyou so much! That worked :)