DateTime issue when global culture of the server is different on different servers

后端 未结 4 1148
闹比i
闹比i 2020-12-10 16:15

My website is hosted on multiple servers at different locations

Everywhere the Culture of the data format is different- we use mm/dd/yyyy format every w

4条回答
  •  时光取名叫无心
    2020-12-10 17:10

    If deployed to a server that's not under your control it's vitally important to make sure your code doesn't have hard-coded dependencies on the culture.

    You'll most likely want to search your code for DateTime.Parse or similar. We have a set of extension methods on DateTime that we use instead to force the correct culture.

提交回复
热议问题