Preserving milliseconds when passing dates around front end

2016-06-08

Instead of passing the datetime pass the datetime.Ticks which is a (long) numeric value so the complete datetime value will be preserved.

Then convert ticks back to datetime in the server (controller action method).


public ActionResult GetChartLightBox(int EmpId, long RangeStartTicks, long RangeEndTicks)
{
   var RangeStart = new DateTime(RangeStartTicks);
   var RangeEnd = new DateTime(RangeEndTicks);

   // ...

}

Leave a comment