.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
Post a Comment