.net - How do I parse a json/javascript date with timezone to C# DateTime? -


how parse date format:

/date(1402537043438+1000)/

to c# datetime?

i'm limited .net 3.5 , can't use nuget package newtonsoft.

javascriptserializer (an external assembly, of sorts, not nuget requirement) can parse dates, need have \ @ start , end of string, e.g.:

var date = "/date(1402537043438+1000)/"; var parseddate = new javascriptserializer().deserialize<datetime>("\"" + date.replace("/", "\\/") + "\""); 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -