using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Web.Script.Serialization; public class CustomJsonConverter : JavaScriptConverter { public override IEnumerable SupportedTypes { get { return new[] { typeof(DateTime) }; } } public override IDictionary Serialize(object obj, JavaScriptSerializer serializer) { var result = new Dictionary(); if (obj is DateTime) { var date = (DateTime)obj; result[""] = date.ToString("yyyy-MM-dd HH:mm:ss"); } return result; } public override object Deserialize(IDictionary dictionary, Type type, JavaScriptSerializer serializer) { throw new NotImplementedException(); } }