Copied to clipboard

Flag this post as spam?

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


  • Thomas Beckert 193 posts 469 karma points
    Jun 25, 2020 @ 08:42
    Thomas Beckert
    0

    Strange DateTime Behavior

    Hi,

    I moved our umbraco Page to a new Server (from 2016 to 2019). No, when I call a function in C# Controller code like: DateTime.Now.ToString() - I get the english format version of the date (e.g . 01/01/2020) Before, the output was 01.01.2020. I setup culture to German in the web.config and most curious about that: in razor, the exact same code as in my C# Controller, renders the Date-String in German. I checked the language of Windows Server 2019, it is also set to German. Only workarround so far is to hand over the culture-Info to the ToString() Version. But I would prefer, that it render the String by Default in the German format. Any idea about this issue?

    Thanks a lot for sharing your ideas.

    Tom

  • Steve Morgan 1348 posts 4457 karma points c-trib
    Jun 25, 2020 @ 14:39
    Steve Morgan
    0

    The only things I can think of are the "Region and Language Options" on the server - you can specify the date format there... or the domain and hostnames in Umbraco might be set to en-US?

  • Thomas Beckert 193 posts 469 karma points
    Jun 25, 2020 @ 14:42
    Thomas Beckert
    0

    Both is set to de-DE / German. :-(

  • Thomas Beckert 193 posts 469 karma points
    Jul 07, 2020 @ 20:30
    Thomas Beckert
    101

    Ok, this link give me the hint: https://www.logicerp.com/tutorials/2019/01/11/change-date-time-format-in-iis-on-windows10/

    You really have to set not only the region to German, you also have to copy that to all users and the "welcome page" of windows server. After restart, all works fine now.

  • Steve Morgan 1348 posts 4457 karma points c-trib
    Jul 09, 2020 @ 08:58
    Steve Morgan
    0

    Urgh!! Glad you've found a fix but some of the UX changes to Windows 10 / Server have been an absolute cludge.

Please Sign in or register to post replies

Write your reply to:

Draft