How to pass a datetime parameter?

后端 未结 10 1696
暗喜
暗喜 2020-11-29 01:56

How to pass UTC dates to Web API?

Passing 2010-01-01 works fine, but when I pass a UTC date such as 2014-12-31T22:00:00.000Z (with a time c

10条回答
  •  抹茶落季
    2020-11-29 02:37

    Since I have encoding ISO-8859-1 operating system the date format "dd.MM.yyyy HH:mm:sss" was not recognised what did work was to use InvariantCulture string.

    string url = "GetData?DagsPr=" + DagsProfs.ToString(CultureInfo.InvariantCulture)
    

提交回复
热议问题