Support_TimeZonepublic class Support_TimeZone extends TimeZone Sample java.util.TimeZone subclass to test getDSTSavings() and getOffset(long)
APIs |
Fields Summary |
---|
private static final long | serialVersionUID | int | rawOffset | boolean | useDaylightTime |
Constructors Summary |
---|
public Support_TimeZone(int rawOffset, boolean useDaylightTime)
this.rawOffset = rawOffset;
this.useDaylightTime = useDaylightTime;
|
Methods Summary |
---|
public int | getOffset(int p1, int p2, int p3, int p4, int p5, int p6)
return 0;
| public int | getRawOffset()
return rawOffset;
| public boolean | inDaylightTime(java.util.Date p1)let's assume this timezone has daylight savings from the 4th month till
the 10th month of the year to ame things simple.
if (!useDaylightTime) {
return false;
}
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(p1);
int month = cal.get(Calendar.MONTH);
if (month > 4 && month < 10) {
return true;
}
return false;
| public void | setRawOffset(int p1)
rawOffset = p1;
| public boolean | useDaylightTime()
return useDaylightTime;
|
|