I copied an example from canvasJS to my ASP.NET MVC project.
It works, but in the example it's passing a date to the view as double:
List<DataPoint> dataPoints = new List<DataPoint>();
dataPoints.Add(new DataPoint(1496255400000, 2500));
dataPoints.Add(new DataPoint(1496341800000, 2790));
dataPoints.Add(new DataPoint(1496428200000, 3380));
ViewBag.DataPoints = JsonConvert.SerializeObject(dataPoints);
return View();
According to the example, these dates are June 1st - June 3rd (not sure what year). Now that I want to use my own data.
How do I convert my DateTime
into this double date format?
Thanks