Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Desborough 3 posts 24 karma points
    Feb 18, 2015 @ 01:00
    Chris Desborough
    0

    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.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 18, 2015 @ 06:53
    Jan Skovgaard
    0

    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

  • Chris Desborough 3 posts 24 karma points
    Feb 19, 2015 @ 02:16
    Chris Desborough
    1

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 19, 2015 @ 06:48
    Jan Skovgaard
    0

    Hi Chris

    Ah yes, without the proper culture things can act weird indeed.

    Happy that you figured it out :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft