Our model has public DateTime date { get; set; }
. In our view, our dates are being stored in the JSON date format. We're then trying to save updates to the date
var someObject = {};
someObject.date = JSONDate;
$.post("Controller/SaveAction", someObject, callback);
and our controller has public JsonResult SaveAction(ModelType model) { ... }
but this code breaks because it is unable to convert the JSON date to a c# DateTime object.
How can I convert the JSON date to something that the post will controller will be able to correctly read into a C# DateTime object?