0

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 ?

Lynn Crumbling
  • 12,985
  • 8
  • 57
  • 95
user2837167
  • 221
  • 1
  • 5
  • 15

2 Answers2

2

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).

Lynn Crumbling
  • 12,985
  • 8
  • 57
  • 95
-1

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.

Triple K
  • 379
  • 1
  • 3
  • 14