public abstract class TimeZone extends Object implements Cloneable
Constructor and Description |
---|
TimeZone()
Timezone object constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a copy of this TimeZone.
|
static String[] |
getAvailableIDs()
Gets all the available IDs supported.
|
static String[] |
getAvailableIDs(int offset)
Gets the available IDs according to the given time zone offset in milliseconds.
|
static TimeZone |
getDefault()
Gets the default TimeZone for this JNIOR.
|
String |
getID()
Returns the time zone ID.
|
abstract int |
getOffset(int era,
int year,
int month,
int day,
int dow,
int tod)
Gets the time zone offset, for current date, modified in case of daylight savings.
|
abstract int |
getRawOffset()
Returns the amount of time in milliseconds to add to UTC to get standard time in this time zone.
|
static TimeZone |
getTimeZone(String abbr)
Gets the TimeZone for the given ID.
|
abstract boolean |
inDaylightTime(Date date)
Queries if the given date is in Daylight Saving Time in this time zone.
|
static void |
setDefault(TimeZone timezone)
Sets the TimeZone that is returned by the getDefault method.
|
void |
setID(String id)
Sets the time zone ID.
|
abstract void |
setRawOffset(int ofs)
Sets the base time zone offset to UTC.
|
abstract boolean |
useDaylightTime()
Queries if this TimeZone uses Daylight Saving Time.
|
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- if not supportedCloneable
public static String[] getAvailableIDs()
public static String[] getAvailableIDs(int offset)
offset
- the offset from UTCpublic static TimeZone getDefault()
public String getID()
public abstract int getOffset(int era, int year, int month, int day, int dow, int tod)
era
- the era of the given dateyear
- the year of the given datemonth
- the month in the given date (0-based, e.g. January is 0)day
- the day of the month in the given datedow
- the day of the week in the given datetod
- the time of the day in milliseconds in standard local timepublic abstract int getRawOffset()
public static TimeZone getTimeZone(String abbr)
abbr
- the ID for a TimeZonepublic abstract boolean inDaylightTime(Date date)
date
- a datepublic static void setDefault(TimeZone timezone)
timezone
- new default TimeZonepublic void setID(String id)
id
- new IDpublic abstract void setRawOffset(int ofs)
ofs
- offset in milliseconds from UTCpublic abstract boolean useDaylightTime()