I have 2 Umbraco 4.7.11 sites hosted on the same server. With the below piece of timezone code, one site displays the AUS date format (dd/MM/yyy) and the other site displays US date format (MM/dd/yyyy) via a usercontrol on a page within the site. I have no globalization settings in the web.config and no Culture settings in the code behind.
Is there a config/xml setting that controls the timezone?
TimeZone zone = TimeZone.CurrentTimeZone;
DateTime local = zone.ToLocalTime(DateTime.Now);
Response.Write(" System Local date is - " + local);
If you have not setup any kind of globalization in the web.config I think it's the server culture that is being used. So if the one server is configured to AUS culture that why it's displaying the AUS format I think.
Timzone settings in Umbraco
I have 2 Umbraco 4.7.11 sites hosted on the same server. With the below piece of timezone code, one site displays the AUS date format (dd/MM/yyy) and the other site displays US date format (MM/dd/yyyy) via a usercontrol on a page within the site. I have no globalization settings in the web.config and no Culture settings in the code behind.
Is there a config/xml setting that controls the timezone?
TimeZone zone = TimeZone.CurrentTimeZone; DateTime local = zone.ToLocalTime(DateTime.Now); Response.Write("
System Local date is - " + local);
Thanks for any help.
Hi Chris
If you have not setup any kind of globalization in the web.config I think it's the server culture that is being used. So if the one server is configured to AUS culture that why it's displaying the AUS format I think.
/Jan
Hi Jan,
Thanks for your help. Both sites were on the same server so ruled out regional/time settings.
Have found the issue and resolved it though, see http://umbraco.tv/videos/implementor/multi-lingual/creating-a-multi-lingual-site/assigning-languages/. Dates now resolve to the correct date format.
Cheers Chris
Hi Chris
Ah yes, without the proper culture things can act weird indeed.
Happy that you figured it out :)
/Jan
is working on a reply...