javascript - How to convert an array of UTC dates into milliseconds using JS/Jquery -
i'm having array of dates:
var ticks = []; ticks = [tue jan 01 2013 00:00:00 gmt-0800 (pst), fri feb 01 2013 00:00:00 gmt-0800 (pst), fri mar 01 2013 00:00:00 gmt-0800 (pst), mon apr 01 2013 00:00:00 gmt-0700 (pdt), wed may 01 2013 00:00:00 gmt-0700 (pdt), sat jun 01 2013 00:00:00 gmt-0700 (pdt), mon jul 01 2013 00:00:00 gmt-0700 (pdt), thu aug 01 2013 00:00:00 gmt-0700 (pdt), sun sep 01 2013 00:00:00 gmt-0700 (pdt)].
how can convert above array of dates millisecond format: below:
[1390000000000, 1395000000000, 1400000000000, 1405000000000, 1410000000000, 1415000000000]
(ps: need format have function takes format display x-axis)
any ideas on how can achieved? thanks!!!!
you map new array date objects:
ticks.map(function ( value ) { return value.gettime(); });
Comments
Post a Comment