Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "LastModifiedDate": "/Date(1301412877000-0400)/"
- public static double JsonTime(DateTime dt)
- {//Convert datetime to a Json Datetime
- DateTime d1 = new DateTime(1970, 1, 1);
- DateTime d2 = dt.ToUniversalTime();
- TimeSpan ts = new TimeSpan(d2.Ticks - d1.Ticks);
- return Math.Round( ts.TotalMilliseconds,0);
- }
- if (data.indexOf("/Date(")==7)
- return new Date(+data.replace(/D/g, ''));
- string Padding = "000";
- for (int f = 1; f <= 256; f++)
- {
- string Hex = "\u" + Padding.Substring(0, 4 - f.ToString().Length) + f;
- string Dec = "&#" + Int32.Parse(f.ToString(), NumberStyles.HexNumber) + ";";
- HTML = HTML.Replace(Hex, Dec);
- }
- HTML = System.Web.HttpUtility.HtmlDecode(HTML);
Add Comment
Please, Sign In to add comment