JsonConvert.DeserializeObject could not convert string to DateTime when using non-us date formats

Try specifying the DateTime format specifically using an IsoDateTimeConverter, and pass it into the JsonConvert.DeserializeObject<>() method.

...
var json = Request.RequestContext.HttpContext.Request.Params["EoiDraftModel"];

var format = "dd/MM/yyyy"; // your datetime format
var dateTimeConverter = new IsoDateTimeConverter { DateTimeFormat = format };

var ld = JsonConvert.DeserializeObject<EoiDraftViewModel>(json, dateTimeConverter);
...

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)