-1

I have a variable called TrackingDate with the type datatime2(7) in sql-server and Nullable<DateTime> in c#. when calling my GET method this is what I get in my JsonResult response:

TrackingDate: "/Date(1563271286005)/"

But the value in my table is actually "2019-07-16 14:31:26.0053912"

What's the problem?

Chris Catignani
  • 4,580
  • 11
  • 39
  • 46
Sarah Gh
  • 7
  • 1

2 Answers2

0

Without more information it is difficult to say for sure, but based on the JsonResult you are not converting the TrackingDate variable correctly from a DateTime to a string. This post might be able to help you out.

Slimelord
  • 59
  • 1
  • 7
0

It seems like the JSON serializer, serialize the date in a wrong way.

try to set the JSON serializer setting "DateFormatString" to "yyyy-MM-dd HH:mm:ss.fffffff"