DthingApi
Public Member Functions | Static Public Attributes | List of all members
java.util.SimpleTimeZone Class Reference
Inheritance diagram for java.util.SimpleTimeZone:
java.util.TimeZone java.io.Serializable

Public Member Functions

 SimpleTimeZone (int offset, final String name)
 
 SimpleTimeZone (int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime)
 
 SimpleTimeZone (int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int daylightSavings)
 
 SimpleTimeZone (int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int daylightSavings)
 
Object clone ()
 
boolean equals (Object object)
 
int getDSTSavings ()
 
int getOffset (int era, int year, int month, int day, int dayOfWeek, int time)
 
int getOffset (long time)
 
int getRawOffset ()
 
synchronized int hashCode ()
 
boolean hasSameRules (TimeZone zone)
 
boolean inDaylightTime (Date time)
 
void setDSTSavings (int milliseconds)
 
void setEndRule (int month, int dayOfMonth, int time)
 
void setEndRule (int month, int day, int dayOfWeek, int time)
 
void setEndRule (int month, int day, int dayOfWeek, int time, boolean after)
 
void setRawOffset (int offset)
 
void setStartRule (int month, int dayOfMonth, int time)
 
void setStartRule (int month, int day, int dayOfWeek, int time)
 
void setStartRule (int month, int day, int dayOfWeek, int time, boolean after)
 
void setStartYear (int year)
 
String toString ()
 
boolean useDaylightTime ()
 
- Public Member Functions inherited from java.util.TimeZone
Object clone ()
 
String getID ()
 
int getDSTSavings ()
 
int getOffset (long time)
 
abstract int getOffset (int era, int year, int month, int day, int dayOfWeek, int timeOfDayMillis)
 
abstract int getRawOffset ()
 
boolean hasSameRules (TimeZone timeZone)
 
abstract boolean inDaylightTime (Date time)
 
void setID (String id)
 
abstract void setRawOffset (int offsetMillis)
 
abstract boolean useDaylightTime ()
 

Static Public Attributes

static final int UTC_TIME = 2
 
static final int STANDARD_TIME = 1
 
static final int WALL_TIME = 0
 
- Static Public Attributes inherited from java.util.TimeZone
static final int SHORT = 0
 
static final int LONG = 1
 

Additional Inherited Members

- Static Public Member Functions inherited from java.util.TimeZone
static synchronized String [] getAvailableIDs ()
 
static synchronized String [] getAvailableIDs (int offsetMillis)
 
static synchronized TimeZone getDefault ()
 
static native String getDefaultId ()
 
static synchronized TimeZone getTimeZone (String id)
 
static synchronized void setDefault (TimeZone timeZone)
 

Detailed Description

is a concrete subclass of

TimeZone

that represents a time zone for use with a Gregorian calendar. This class does not handle historical changes.

Use a negative value for

dayOfWeekInMonth

to indicate that

should count from the end of the month backwards. For example, Daylight Savings Time ends at the last (dayOfWeekInMonth = -1) Sunday in October, at 2 AM in standard time.

See also
Calendar
GregorianCalendar
TimeZone

Constructor & Destructor Documentation

◆ SimpleTimeZone() [1/4]

java.util.SimpleTimeZone.SimpleTimeZone ( int  offset,
final String  name 
)
inline

Constructs a

with the given base time zone offset from GMT and time zone ID. Timezone IDs can be obtained from

TimeZone.getAvailableIDs

. Normally you should use

TimeZone.getDefault

to construct a

TimeZone

.

Parameters
offsetthe given base time zone offset to GMT.
namethe time zone ID which is obtained from
TimeZone.getAvailableIDs
.

◆ SimpleTimeZone() [2/4]

java.util.SimpleTimeZone.SimpleTimeZone ( int  offset,
String  name,
int  startMonth,
int  startDay,
int  startDayOfWeek,
int  startTime,
int  endMonth,
int  endDay,
int  endDayOfWeek,
int  endTime 
)
inline

Constructs a

with the given base time zone offset from GMT, time zone ID, and times to start and end the daylight savings time. Timezone IDs can be obtained from

TimeZone.getAvailableIDs

. Normally you should use

TimeZone.getDefault

to create a

TimeZone

. For a time zone that does not use daylight saving time, do not use this constructor; instead you should use

SimpleTimeZone(rawOffset, ID)

.

By default, this constructor specifies day-of-week-in-month rules. That is, if the

startDay

is 1, and the

startDayOfWeek

is

SUNDAY

, then this indicates the first Sunday in the

startMonth

. A

startDay

of -1 likewise indicates the last Sunday. However, by using negative or zero values for certain parameters, other types of rules can be specified.

Day of month: To specify an exact day of the month, such as March 1, set

startDayOfWeek

to zero.

Day of week after day of month: To specify the first day of the week occurring on or after an exact day of the month, make the day of the week negative. For example, if

startDay

is 5 and

startDayOfWeek

is

-MONDAY

, this indicates the first Monday on or after the 5th day of the

startMonth

.

Day of week before day of month: To specify the last day of the week occurring on or before an exact day of the month, make the day of the week and the day of the month negative. For example, if

startDay

is

-21

and

startDayOfWeek

is

-WEDNESDAY

, this indicates the last Wednesday on or before the 21st of the

startMonth

.

The above examples refer to the

startMonth

,

startDay

, and

startDayOfWeek

; the same applies for the

endMonth

,

endDay

, and

endDayOfWeek

.

The daylight savings time difference is set to the default value: one hour.

Parameters
offsetthe given base time zone offset to GMT.
namethe time zone ID which is obtained from
TimeZone.getAvailableIDs
.
startMonththe daylight savings starting month. The month indexing is 0-based. eg, 0 for January.
startDaythe daylight savings starting day-of-week-in-month. Please see the member description for an example.
startDayOfWeekthe daylight savings starting day-of-week. Please see the member description for an example.
startTimethe daylight savings starting time in local wall time, which is standard time in this case. Please see the member description for an example.
endMonththe daylight savings ending month. The month indexing is 0-based. eg, 0 for January.
endDaythe daylight savings ending day-of-week-in-month. Please see the member description for an example.
endDayOfWeekthe daylight savings ending day-of-week. Please see the member description for an example.
endTimethe daylight savings ending time in local wall time, which is daylight time in this case. Please see the member description for an example.
Exceptions
IllegalArgumentExceptionif the month, day, dayOfWeek, or time parameters are out of range for the start or end rule.

◆ SimpleTimeZone() [3/4]

java.util.SimpleTimeZone.SimpleTimeZone ( int  offset,
String  name,
int  startMonth,
int  startDay,
int  startDayOfWeek,
int  startTime,
int  endMonth,
int  endDay,
int  endDayOfWeek,
int  endTime,
int  daylightSavings 
)
inline

Constructs a

with the given base time zone offset from GMT, time zone ID, times to start and end the daylight savings time, and the daylight savings time difference in milliseconds.

Parameters
offsetthe given base time zone offset to GMT.
namethe time zone ID which is obtained from
TimeZone.getAvailableIDs
.
startMonththe daylight savings starting month. Month is 0-based. eg, 0 for January.
startDaythe daylight savings starting day-of-week-in-month. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
startDayOfWeekthe daylight savings starting day-of-week. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
startTimeThe daylight savings starting time in local wall time, which is standard time in this case. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
endMonththe daylight savings ending month. Month is 0-based. eg, 0 for January.
endDaythe daylight savings ending day-of-week-in-month. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
endDayOfWeekthe daylight savings ending day-of-week. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
endTimethe daylight savings ending time in local wall time, which is daylight time in this case. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
daylightSavingsthe daylight savings time difference in milliseconds.
Exceptions
IllegalArgumentExceptionif the month, day, dayOfWeek, or time parameters are out of range for the start or end rule.

◆ SimpleTimeZone() [4/4]

java.util.SimpleTimeZone.SimpleTimeZone ( int  offset,
String  name,
int  startMonth,
int  startDay,
int  startDayOfWeek,
int  startTime,
int  startTimeMode,
int  endMonth,
int  endDay,
int  endDayOfWeek,
int  endTime,
int  endTimeMode,
int  daylightSavings 
)
inline

Construct a

with the given base time zone offset from GMT, time zone ID, times to start and end the daylight savings time including a mode specifier, the daylight savings time difference in milliseconds. The mode specifies either WALL_TIME, STANDARD_TIME, or UTC_TIME.

Parameters
offsetthe given base time zone offset to GMT.
namethe time zone ID which is obtained from
TimeZone.getAvailableIDs
.
startMonththe daylight savings starting month. The month indexing is 0-based. eg, 0 for January.
startDaythe daylight savings starting day-of-week-in-month. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
startDayOfWeekthe daylight savings starting day-of-week. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
startTimethe time of day in milliseconds on which daylight savings time starts, based on the
startTimeMode
.
startTimeModethe mode (UTC, standard, or wall time) of the start time value.
endDaythe day of the week on which daylight savings time ends.
endMonththe daylight savings ending month. The month indexing is 0-based. eg, 0 for January.
endDayOfWeekthe daylight savings ending day-of-week. Please see the description of SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) for an example.
endTimethe time of day in milliseconds on which daylight savings time ends, based on the
endTimeMode
.
endTimeModethe mode (UTC, standard, or wall time) of the end time value.
daylightSavingsthe daylight savings time difference in milliseconds.
Exceptions
IllegalArgumentExceptionif the month, day, dayOfWeek, or time parameters are out of range for the start or end rule.

Member Function Documentation

◆ clone()

Object java.util.SimpleTimeZone.clone ( )
inline

Returns a new

with the same ID,

rawOffset

and daylight savings time rules as this SimpleTimeZone.

Returns
a shallow copy of this .
See also
java.lang.Cloneable

◆ equals()

boolean java.util.SimpleTimeZone.equals ( Object  object)
inline

Compares the specified object to this

and returns whether they are equal. The object must be an instance of

and have the same internal data.

Parameters
objectthe object to compare with this object.
Returns
true
if the specified object is equal to this ,
false
otherwise.
See also
hashCode

◆ hashCode()

synchronized int java.util.SimpleTimeZone.hashCode ( )
inline

Returns an integer hash code for the receiver. Objects which are equal return the same value for this method.

Returns
the receiver's hash.
See also
equals

◆ setDSTSavings()

void java.util.SimpleTimeZone.setDSTSavings ( int  milliseconds)
inline

Sets the daylight savings offset in milliseconds for this

.

Parameters
millisecondsthe daylight savings offset in milliseconds.

◆ setEndRule() [1/3]

void java.util.SimpleTimeZone.setEndRule ( int  month,
int  dayOfMonth,
int  time 
)
inline

Sets the rule which specifies the end of daylight savings time.

Parameters
monththe
Calendar
month in which daylight savings time ends.
dayOfMonththe
Calendar
day of the month on which daylight savings time ends.
timethe time of day in milliseconds standard time on which daylight savings time ends.

◆ setEndRule() [2/3]

void java.util.SimpleTimeZone.setEndRule ( int  month,
int  day,
int  dayOfWeek,
int  time 
)
inline

Sets the rule which specifies the end of daylight savings time.

Parameters
monththe
Calendar
month in which daylight savings time ends.
daythe occurrence of the day of the week on which daylight savings time ends.
dayOfWeekthe
Calendar
day of the week on which daylight savings time ends.
timethe time of day in milliseconds standard time on which daylight savings time ends.

◆ setEndRule() [3/3]

void java.util.SimpleTimeZone.setEndRule ( int  month,
int  day,
int  dayOfWeek,
int  time,
boolean  after 
)
inline

Sets the rule which specifies the end of daylight savings time.

Parameters
monththe
Calendar
month in which daylight savings time ends.
daythe
Calendar
day of the month.
dayOfWeekthe
Calendar
day of the week on which daylight savings time ends.
timethe time of day in milliseconds on which daylight savings time ends.
afterselects the day after or before the day of month.

◆ setRawOffset()

void java.util.SimpleTimeZone.setRawOffset ( int  offset)
inline

Sets the offset for standard time from GMT for this

.

Parameters
offsetthe offset from GMT of standard time in milliseconds.

◆ setStartRule() [1/3]

void java.util.SimpleTimeZone.setStartRule ( int  month,
int  dayOfMonth,
int  time 
)
inline

Sets the rule which specifies the start of daylight savings time.

Parameters
monththe
Calendar
month in which daylight savings time starts.
dayOfMonththe
Calendar
day of the month on which daylight savings time starts.
timethe time of day in milliseconds on which daylight savings time starts.

◆ setStartRule() [2/3]

void java.util.SimpleTimeZone.setStartRule ( int  month,
int  day,
int  dayOfWeek,
int  time 
)
inline

Sets the rule which specifies the start of daylight savings time.

Parameters
monththe
Calendar
month in which daylight savings time starts.
daythe occurrence of the day of the week on which daylight savings time starts.
dayOfWeekthe
Calendar
day of the week on which daylight savings time starts.
timethe time of day in milliseconds on which daylight savings time starts.

◆ setStartRule() [3/3]

void java.util.SimpleTimeZone.setStartRule ( int  month,
int  day,
int  dayOfWeek,
int  time,
boolean  after 
)
inline

Sets the rule which specifies the start of daylight savings time.

Parameters
monththe
Calendar
month in which daylight savings time starts.
daythe
Calendar
day of the month.
dayOfWeekthe
Calendar
day of the week on which daylight savings time starts.
timethe time of day in milliseconds on which daylight savings time starts.
afterselects the day after or before the day of month.

◆ setStartYear()

void java.util.SimpleTimeZone.setStartYear ( int  year)
inline

Sets the starting year for daylight savings time in this

. Years before this start year will always be in standard time.

Parameters
yearthe starting year.

◆ toString()

String java.util.SimpleTimeZone.toString ( )
inline

Returns the string representation of this

.

Returns
the string representation of this .

Member Data Documentation

◆ STANDARD_TIME

final int java.util.SimpleTimeZone.STANDARD_TIME = 1
static

The constant for representing a start or end time in standard local time mode, based on timezone's raw offset from GMT; does not include Daylight savings.

◆ UTC_TIME

final int java.util.SimpleTimeZone.UTC_TIME = 2
static

The constant for representing a start or end time in GMT time mode.

◆ WALL_TIME

final int java.util.SimpleTimeZone.WALL_TIME = 0
static

The constant for representing a start or end time in local wall clock time mode, based on timezone's adjusted offset from GMT; includes Daylight savings.


The documentation for this class was generated from the following file: