How to return json date from MVC4 controller in ISO format
I tried tro return date in ISO format using Json.Net from ASP.NET MVC4 controller public JsonResult Sales() { var saleList = new List<Sale>(); ... var str = JsonConvert.SerializeObject(saleList); return Json(str, JsonRequestBehavior.AllowGet); } public class Sale { public DateTime saledate { get; set; } ... } But it returns whole object json notation as single string. How to return date in ISO format as json object ? You can do it with ServiceStack JSON serializer but first you have to integrate it to ASP.NET MVC. After installing the package, configure DateTime serialization in application