Reputation: 231
The Json value of kendodatepicker that is received at .net csharp code is
"\"2013-11-18T03:38:21.843Z\""
What is the best and universal way to parse/convert this format to c# DateTime ?
Upvotes: 0
Views: 2473
Reputation: 399
From kendo dateTime to .net DateTime
var datepicker = $("#datepicker").data("kendoDatePicker");
var value = datepicker.value();
kendo.toString(value,"dd/MM/yyyy")
Try it sir.It might helps u.
Upvotes: -1
Reputation: 13357
If you want to have it convert it to localtime, use:
DateTime dt = DateTime.Parse("2013-11-18T03:38:21.843Z")
To keep it as UTC, drop the Z off of the end:
DateTime dt = DateTime.Parse("2013-11-18T03:38:21.843")
Don't forget to dump all of those quotes and escape quotes if they really are present in the string (and not just there because of debugger output).
Upvotes: 2