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
As a similar alternative to s k's answer, I am able to pass a date formatted by Date.prototype.toISOString() in the query string. This is the standard ISO 8601 format, and it is accepted by .Net Web API controllers without any additional configuration of the route or action.
e.g.
var dateString = dateObject.toISOString(); // "2019-07-01T04:00:00.000Z"