java.lang.Object | |
↳ | org.rrd4j.core.timespec.TimeSpec |
Simple class to represent time obtained by parsing at-style date specification (described
in detail on the rrdfetch man page. See javadoc for TimeParser
for more information.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Use this static method to resolve relative time references and obtain the corresponding
Calendar objects.
| |||||||||||
Returns the corresponding timestamp (seconds since Epoch).
| |||||||||||
Use this static method to resolve relative time references and obtain the corresponding
timestamps (seconds since epoch).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Use this static method to resolve relative time references and obtain the corresponding Calendar objects. Example:
TimeParser pStart = new TimeParser("now-1month"); // starting time TimeParser pEnd = new TimeParser("start+1week"); // ending time TimeSpec specStart = pStart.parse(); TimeSpec specEnd = pEnd.parse(); GregorianCalendar[] gc = TimeSpec.getTimes(specStart, specEnd);
spec1 | Starting time specification |
---|---|
spec2 | Ending time specification |
Returns the corresponding timestamp (seconds since Epoch). Example:
TimeParser p = new TimeParser("now-1day"); TimeSpec ts = p.parse(); System.out.println("Timestamp was: " + ts.getTimestamp();
Use this static method to resolve relative time references and obtain the corresponding timestamps (seconds since epoch). Example:
TimeParser pStart = new TimeParser("now-1month"); // starting time TimeParser pEnd = new TimeParser("start+1week"); // ending time TimeSpec specStart = pStart.parse(); TimeSpec specEnd = pEnd.parse(); long[] ts = TimeSpec.getTimestamps(specStart, specEnd);
spec1 | Starting time specification |
---|---|
spec2 | Ending time specification |