我try 将UTC日期作为查询字符串参数传递给Web API方法.URL如下所示
/api/order?endDate=2014-04-01T00:00:00Z&zoneId=4
The signature of the method looks like
[HttpGet]
public object Index(int zoneId, DateTime? endDate = null)
The date is coming in as 31/03/2014 8:00:00 PM
but I'd like it to come in as 01/04/2014 12:00:00 AM
My JsonFormatter.SerializerSettings
looks like this
new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
DateFormatHandling = DateFormatHandling.IsoDateFormat
};
编辑#1: