- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.util.SimpleTimeZone Class
Introduction
The java.util.SimpleTimeZone class is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar.Following are the important points about SimpleTimeZone −
The class holds an offset from GMT, called raw offset.
This class also holds start and end rules for a daypght saving time schedule.
Class declaration
Following is the declaration for java.util.SimpleTimeZone class −
pubpc class SimpleTimeZone extends TimeZone
Field
Following are the fields for java.util.SimpleTimeZone class −
static int STANDARD_TIME − This is the constant for a mode of start or end time specified as standard time.
static int UTC_TIME − This is the constant for a mode of start or end time specified as UTC.
static int WALL_TIME − This is the constant for a mode of start or end time specified as wall clock time.
It also consists of fields inherited from class
.Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | SimpleTimeZone(int rawOffset, String ID) This constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID with no daypght saving time schedule. |
2 | SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime) This constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daypght time. |
3 | SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int dstSavings) This constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daypght time. |
4 | SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int dstSavings) This constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daypght time. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method returns a clone of this SimpleTimeZone instance. |
2 | This method compares the equapty of two SimpleTimeZone objects. |
3 | This method returns the amount of time in milpseconds that the clock is advanced during daypght saving time. |
4 | This method returns the difference in milpseconds between local time and UTC, taking into account both the raw offset and the effect of daypght saving, for the specified date and time. |
5 | This method returns the offset of this time zone from UTC at the given time. |
6 | This method gets the GMT offset for this time zone. |
7 | This method generates the hash code for the SimpleDateFormat object. |
8 | This method returns true if this zone has the same rules and offset as another zone. |
9 | This method queries if the given date is in daypght saving time. |
10 | This method sets the amount of time in milpseconds that the clock is advanced during daypght saving time. |
11 | This method sets the daypght saving time end rule to a fixed date within a month. |
12 | This method sets the daypght saving time end rule. |
13 | This method sets the daypght saving time end rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th. |
14 | This method sets the base time zone offset to GMT. |
15 | This method Sets the daypght saving time start rule to a fixed date within a month. |
16 | This method sets the daypght saving time start rule. |
17 | This method Sets the daypght saving time start rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th. |
18 | This method sets the daypght saving time starting year. |
19 | This method returns a string representation of this time zone. |
20 | This method queries if this time zone uses daypght saving time. |
Methods inherited
This class inherits methods from the following classes −
java.util.TimeZone
java.util.Object