I'm suddenly having problems with the C# DateTime.ToString() method which I have never seen before. I'm working on a project which was working just fine before the weekend and now come Monday, all my DateTime strings are with periods instead of colons (i.e. 2020-12-14 13:45:33 becomes 2020-12-14 13.45.33).
I'm using this format string "yyyy-MM-dd HH:mm:ss" when creating strings from my DateTime objects and it has always worked for me, but now this... What is going on?
This just happened over night and I have no idea as to why...
Anyone has an idea to why this is happening and how to fix it?
EDIT: to answer a few questions in comments - I live in Denmark, OS is Windows 10 x64, framework is .NET 4.7.2.
EDIT 2: I have fixed my problem for now by adding a section to the web.config of my web application, but I still have no idea why this is suddenly required from one day to the other.
I added the following to the system.web section of the web.config:
<globalization culture="en-US" uiCulture="da-DK" />
The uiCulture isn't important in this case, but the culture="en-US" changed the dots back to colons in the time part of the datetime strings as I needed them to be and my web application is back to running normally again...