public static class TimeParts.TimeZoneOffset extends Object
TimeScanner.scan(ch.agent.t2.time.Resolution, java.lang.String)
and passed to a TimeParts
to be processed by TimeTools.makeRawIndex(ch.agent.t2.time.Resolution, ch.agent.t2.time.TimeParts)
.
In a time zone offset, components are either all positive or all negative. The sign is determined by a parameter passed to the constructor. All components are set using positive values.
With a positive offset, the components will be subtracted from the given
time, and with a negative offset they will be added to it. For example in the
time representation 2001-06-15T02:00+05:00
, there is a positive
offset of five hours and the method getHour()
returns
5. Applying the offset results in the time 2001-06-14T21:00
.
Constructor and Description |
---|
TimeZoneOffset(Resolution unit,
boolean negative,
int hour,
int min,
int sec,
int fsec)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getFsec()
Return the number to subtract from the fractional second.
|
int |
getHour()
Return the number to subtract from the hour.
|
int |
getMin()
Return the number to subtract from the minute.
|
int |
getSec()
Return the number to subtract from the second.
|
boolean |
isNegative()
Return true is offset is negative.
|
String |
toString() |
public TimeZoneOffset(Resolution unit, boolean negative, int hour, int min, int sec, int fsec) throws T2Exception
unit
- time unit resolutionnegative
- negative time zone offsethour
- offset hoursmin
- offset minutessec
- offset secondsfsec
- offset fractional seconds (millis, micros, etc. depending on the
resolution)T2Exception
public boolean isNegative()
public int getHour()
public int getMin()
public int getSec()
public int getFsec()
Copyright © 2017. All rights reserved.