Convert Time

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
marcio.nandi
Posts: 5
Joined: Wed Sep 09, 2015 2:47 pm
antibot: No, of course not.

Convert Time

Post by marcio.nandi » Tue Oct 13, 2015 7:41 pm

Hello. I need to convert 2 values of Millisecond to numbers because I need to make a linear aproximation with these values. I don't know what parameter use to convert these time units. Any help will be usefull.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Convert Time

Post by david.gilbert » Wed Oct 14, 2015 5:20 am

The Millisecond class uses a similar underlying encoding for a timestamp as java.util.Date (a long integer containing the number of milliseconds since midnight 1-Jan-1970 UTC). In addition, like the other RegularTimePeriod classes in JFreeChart, it supports "pegging" to a timezone.

The getMillisecond() method method will return the raw or "unpegged" value (same as java.util.Date). To get the "pegged" value, call getFirstMillisecond() or getLastMillisecond() (both will return the same value).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked