首页 > 代码库 > WCF JSON DATETIME JSON.NET (Newtonsoft.Json.dll)

WCF JSON DATETIME JSON.NET (Newtonsoft.Json.dll)

[DataMember]
public DateTime? myTime { get; set; }




var
timeFormat = new JsonSerializerSettings() { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }; string json = JsonConvert.SerializeObject(send, timeFormat);ResultData rd = JsonConvert.DeserializeObject<ResultData>(rststr, timeFormat);

 

客户端是用JSON.NET (Newtonsoft.Json.dll)

发送和接收都用

MicrosoftDateFormat

WCF JSON DATETIME JSON.NET (Newtonsoft.Json.dll)