I need to deploy an ASP.NET application written in C# to multiple servers and cannot be sure what the regional settings are. How can I read the current date (DateTime.Today) into a DateTime variable using the server’s locale and specify the format that I wish it to be in. This way giving me a consistently formatted date that I can then manipulate as desired.
Share
Note, that region settings only affects string representation, i.e. format, but not DateTime type itself!