Convert javascript ticks to date in Flot jQuery-plugin issue
- by Kasper Skov
I have a dynamic Flot graph with dates on the x-axis and numbers on the y-axis. To get the Flot-plugin to read the date object correctly, I had to convert the dates to ticks (with getTime()). My problem is that I can't revers the ticks back to a normal date in my tooltip hover on the graph.
I've tried to revers it with this:
dateTimeObject = new Date((jsTicks - 621355968000000000) / 10000);
All I get, no matter what jsTicks is, is "Jan 02 0001 hh:mm:ss (almost current time)"
What am I doing wrong?