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
2010-01-01
2014-12-31T22:00:00.000Z
It used to be a painful task, but now we can use toUTCString():
Example:
[HttpPost] public ActionResult Query(DateTime Start, DateTime End)
Put the below into Ajax post request
data: { Start: new Date().toUTCString(), End: new Date().toUTCString() },