Stay organized with collections
Save and categorize content based on your preferences.
java.time.zone
Support for time-zones and their rules.
Daylight Saving Time and Time-Zones are concepts used by Governments to alter local time.
This package provides support for time-zones, their rules and the resulting
gaps and overlaps in the local time-line typically caused by Daylight Saving Time.
Package specification
Unless otherwise noted, passing a null argument to a constructor or method in any class or interface
in this package will cause a NullPointerException
to be thrown.
The Javadoc "@param" definition is used to summarise the null-behavior.
The "@throws NullPointerException
" is not explicitly documented in each method.
All calculations should check for numeric overflow and throw either an ArithmeticException
or a DateTimeException
.
Classes
Enums
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# java.time.zone\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\njava.time.zone\n==============\n\n\nSupport for time-zones and their rules.\n\n\nDaylight Saving Time and Time-Zones are concepts used by Governments to alter local time.\nThis package provides support for time-zones, their rules and the resulting\ngaps and overlaps in the local time-line typically caused by Daylight Saving Time.\n\nPackage specification\n---------------------\n\n\nUnless otherwise noted, passing a null argument to a constructor or method in any class or interface\nin this package will cause a [NullPointerException](/reference/java/lang/NullPointerException) to be thrown.\nThe Javadoc \"@param\" definition is used to summarise the null-behavior.\nThe \"@throws [NullPointerException](/reference/java/lang/NullPointerException)\" is not explicitly documented in each method.\n\n\nAll calculations should check for numeric overflow and throw either an [ArithmeticException](/reference/java/lang/ArithmeticException)\nor a [DateTimeException](/reference/java/time/DateTimeException).\n\nClasses\n-------\n\n|--------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| [ZoneOffsetTransition](/reference/java/time/zone/ZoneOffsetTransition) | A transition between two offsets caused by a discontinuity in the local time-line. |\n| [ZoneOffsetTransitionRule](/reference/java/time/zone/ZoneOffsetTransitionRule) | A rule expressing how to create a transition. |\n| [ZoneRules](/reference/java/time/zone/ZoneRules) | The rules defining how the zone offset varies for a single time-zone. |\n\nEnums\n-----\n\n|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| [ZoneOffsetTransitionRule.TimeDefinition](/reference/java/time/zone/ZoneOffsetTransitionRule.TimeDefinition) | A definition of the way a local time can be converted to the actual transition date-time. |\n\nExceptions\n----------\n\n|--------------------------------------------------------------------|------------------------------------------------------------|\n| [ZoneRulesException](/reference/java/time/zone/ZoneRulesException) | Thrown to indicate a problem with time-zone configuration. |\n\n-\n\n Classes\n -------\n\n - [ZoneOffsetTransition](/reference/java/time/zone/ZoneOffsetTransition)\n - [ZoneOffsetTransitionRule](/reference/java/time/zone/ZoneOffsetTransitionRule)\n - [ZoneRules](/reference/java/time/zone/ZoneRules)\n-\n\n Enums\n -----\n\n - [ZoneOffsetTransitionRule.TimeDefinition](/reference/java/time/zone/ZoneOffsetTransitionRule.TimeDefinition)\n-\n\n Exceptions\n ----------\n\n - [ZoneRulesException](/reference/java/time/zone/ZoneRulesException)"]]