I am trying to use highcharts to show some data over the last 24 hours. The chart requires the start time when you use the time for the x axis like in this example Highcharts time example. I can't figure out how to tell it to start 24 hours ago for example, if the time now was 22:34pm on the 18th, I want it to start at 22:34pm on the 17th. I am not very good with time and date related code and JavaScript is also not my strong point.
I believe I would need the finished output to be something like:
pointStart: Date.UTC(2012, 5, 17, 22, 34)
For the above example, but I'm not so sure how to get that from Date().
Edit: I am not sure why it was marked as a duplicate but I was trying to get a time relative to the current time (now - 24h), not a relative string representation (“twenty four hours ago”). The other question also does not mention highcharts at all.