highstock-processing time requires processing world time offset

Source: Internet
Author: User

Highstock's data format uses [[Time, Data],[time, data],[time, data],[time, data]], and time uses 13-bit millisecond values, such as [1133136000000,69.66], The time format used is UTC (World standard Time), so in the background to the time processing, not just a simple conversion to millisecond value, if only for millisecond value, in the foreground of the graphics will appear in the data line and time dislocation phenomenon. Only millisecond values converted to UTC will not appear misaligned.

Java takes the millisecond value under UTC:

Nullnew SimpleDateFormat ("yyyy-mm-dd"= Df.parse ("2012-11-26"=  Calendar.getinstance (Timezone.getdefault ()); // Timezone.getdefault () Gets the host's default TimeZone, which is the time zone offset. Cal.settime (date); List.add (Date.gettime () +cal.gettimezone (). Getrawoffset ()); // Cal.gettimezone (). Getrawoffset () is a relative offset from UTC // date.gettime () +cal.gettimezone (). Getrawoffset () is the millisecond value of the corresponding UTC in 2012-11-26 non-UTC format milliseconds

UTC format milliseconds

highstock-processing time requires processing world time offset

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.