| Package | Description | 
|---|---|
| java.text | Provides classes and interfaces for handling text, dates, numbers, and messages
in a manner independent of natural languages. | 
| java.util | Contains the collections framework, legacy collection classes, event model,
date and time facilities, internationalization, and miscellaneous utility
classes (a string tokenizer, a random-number generator, and a bit array). | 
| javax.xml.datatype | XML/Java Type Mappings. | 
| Modifier and Type | Method and Description | 
|---|---|
| TimeZone | DateFormat. getTimeZone()Gets the time zone. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | DateFormat. setTimeZone(TimeZone zone)Sets the time zone for the calendar of this  DateFormatobject. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | SimpleTimeZoneSimpleTimeZoneis a concrete subclass ofTimeZonethat represents a time zone for use with a Gregorian calendar. | 
| Modifier and Type | Method and Description | 
|---|---|
| static TimeZone | TimeZone. getDefault()Gets the default  TimeZoneof the Java virtual machine. | 
| TimeZone | GregorianCalendar. getTimeZone() | 
| TimeZone | Calendar. getTimeZone()Gets the time zone. | 
| static TimeZone | TimeZone. getTimeZone(String ID)Gets the  TimeZonefor the given ID. | 
| static TimeZone | TimeZone. getTimeZone(ZoneId zoneId)Gets the  TimeZonefor the givenzoneId. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Calendar | Calendar. getInstance(TimeZone zone)Gets a calendar using the specified time zone and default locale. | 
| static Calendar | Calendar. getInstance(TimeZone zone,
           Locale aLocale)Gets a calendar with the specified time zone and locale. | 
| boolean | SimpleTimeZone. hasSameRules(TimeZone other)Returns  trueif this zone has the same rules and offset as another zone. | 
| boolean | TimeZone. hasSameRules(TimeZone other)Returns true if this zone has the same rule and offset as another zone. | 
| static void | TimeZone. setDefault(TimeZone zone)Sets the  TimeZonethat is returned by thegetDefaultmethod. | 
| void | GregorianCalendar. setTimeZone(TimeZone zone) | 
| void | Calendar. setTimeZone(TimeZone value)Sets the time zone with the given time zone value. | 
| Calendar.Builder | Calendar.Builder. setTimeZone(TimeZone zone)Sets the time zone parameter to the given  zone. | 
| Constructor and Description | 
|---|
| Calendar(TimeZone zone,
        Locale aLocale)Constructs a calendar with the specified time zone and locale. | 
| GregorianCalendar(TimeZone zone)Constructs a  GregorianCalendarbased on the current time
 in the given time zone with the defaultFORMATlocale. | 
| GregorianCalendar(TimeZone zone,
                 Locale aLocale)Constructs a  GregorianCalendarbased on the current time
 in the given time zone with the given locale. | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract TimeZone | XMLGregorianCalendar. getTimeZone(int defaultZoneoffset)Returns a  java.util.TimeZonefor this class. | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract GregorianCalendar | XMLGregorianCalendar. toGregorianCalendar(TimeZone timezone,
                   Locale aLocale,
                   XMLGregorianCalendar defaults)Convert this  XMLGregorianCalendaralong with provided parameters
 to aGregorianCalendarinstance. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.