Parsing a JSON date info into a C# DateTime

前端 未结 4 1925
小鲜肉
小鲜肉 2021-01-11 19:11

I have a a WCF service that returns a CLR object. This object is defined as follows:

[DataContract]
public class Person
{
  [DataMember]
  public string Full         


        
4条回答
  •  [愿得一人]
    2021-01-11 19:25

    This solved my problem

    using System.Web.Script.Serialization;
    
    
    //code
    JavaScriptSerializer json_serializer = new JavaScriptSerializer();
    DateTime ddate = json_serializer.Deserialize(@"""\/Date(1326038400000)\/""").ToLocalTime();
    

提交回复
热议问题