两个日期时间进入JavaScriptSerializer,两者都有DateTimeKind.Unspecified
一个人落后一小时。如何让两个日期连续排序?
输入JavaScriptSerializer.Serialize():
[DataMember]
public DateTime? CoverStartDate { get; set; }
[DataMember]
public DriverInfo[] Drivers { get; set; }
public class DriverInfo : IDriverInfo
{
[DataMember]
public DateTime? DateOfBirth { get; set; }
}
JavaScriptSerializer.Serialize()的输出:
{"SiteId":24,"RegionId":2,"SchemeId":null,"SchemeTypeId":null,"IsAnnual":null,"Drivers":[{"DisplayIndex":0,"Title":null,"FirstName":null,"LastName":null,"Age":51,"DateOfBirth":"\/Date(-155001600000)\/","IsLeadDriver":true}],"CoverStartDate":"\/Date(1471042800000)\/","TripDuration":15}
如何使两个DateTimes一致地序列化?