How to make ASP.Net MVC model binder treat incoming date as UTC?

后端 未结 5 2019
感动是毒
感动是毒 2020-12-01 03:59

I\'m posting an object to an MVC controller. The object contains a field called StartDt and on the client it is a javascript Date object in local time.

When I call J

5条回答
  •  醉话见心
    2020-12-01 04:10

    You may have to use the DateTime.ToUniversalTime() method to get back the UTC time.

提交回复
热议问题