syed mhamudul hasan akash syed mhamudul hasan akash - 8 months ago 54
JSON Question

Unknown date format in Api

I am working with HighStock chart link

It use data from a api apilink

First parameter is date like

/* Sep 2009 */

What is this date format ? How to get this format is C#?


This appears to be a JavaScript date value, which is provided in terms of milliseconds elapsed since the epoch of January 1st, 1970.

You can convert it to a DateTime several ways in C#.

For example (from the link above), you can add the ticks elapsed since the JavaScript epoch. To convert from milliseconds to ticks, multiply by 10,000. Therefore you could write the following:

new DateTime(1970, 1, 1).AddTicks(1252368000000 * 10000);