javascript - Weird Date Format Help -
i created extension method uses built-in asp.net serializer serialize objects json send server via ajax so:
namespace extensionmethods.json { public static class jsonhelper { public static string tojson(this object obj) { javascriptserializer serializer = new javascriptserializer(); return serializer.serialize(obj); } public static string tojson(this object obj, int recursiondepth) { javascriptserializer serializer = new javascriptserializer(); serializer.recursionlimit = recursiondepth; return serializer.serialize(obj); } } } //usage string json = myobject.tojson(); this works fine, except dates, sends dates in format:
/date(1291276800000)/ is there way fix serverside date comes more manageable, or have stupid character parsing on client side (ie, scrape digits out of parens , try set date using number milliseconds)? or there better way i'm overlooking? i've tried date.parse([the date]) errors out "invalid date format".
that valid json date. have @ other question date back. how format microsoft json date?
Comments
Post a Comment