java.time.zone
Stay organized with collections
Save and categorize content based on your preferences.
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-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 2024-07-10 UTC."],[[["\u003cp\u003eThis package supports time-zones, including Daylight Saving Time rules and resulting time-line gaps/overlaps.\u003c/p\u003e\n"],["\u003cp\u003eIt provides classes for managing time-zone rules, transitions, and offsets, using ICU4J TimeZones for rule generation.\u003c/p\u003e\n"],["\u003cp\u003eNull arguments passed to constructors or methods will result in a NullPointerException.\u003c/p\u003e\n"],["\u003cp\u003eCalculations check for numeric overflow, throwing ArithmeticException or DateTimeException.\u003c/p\u003e\n"],["\u003cp\u003eZoneRulesException is thrown to indicate time-zone configuration issues.\u003c/p\u003e\n"]]],[],null,["# java.time.zone\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\n### Package specification\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.html) to be thrown.\nThe Javadoc \"@param\" definition is used to summarise the null-behavior.\nThe \"@throws [NullPointerException](../../../../reference/java/lang/NullPointerException.html)\" 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.html)\nor a [DateTimeException](../../../../reference/java/time/DateTimeException.html).\n\n### Classes\n\n|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| [IcuZoneRulesProvider](../../../../reference/java/time/zone/IcuZoneRulesProvider.html) | A ZoneRulesProvider that generates rules from ICU4J TimeZones. |\n| [ZoneOffsetTransition](../../../../reference/java/time/zone/ZoneOffsetTransition.html) | A transition between two offsets caused by a discontinuity in the local time-line. |\n| [ZoneOffsetTransitionRule](../../../../reference/java/time/zone/ZoneOffsetTransitionRule.html) | A rule expressing how to create a transition. |\n| [ZoneRules](../../../../reference/java/time/zone/ZoneRules.html) | The rules defining how the zone offset varies for a single time-zone. |\n| [ZoneRulesProvider](../../../../reference/java/time/zone/ZoneRulesProvider.html) | Provider of time-zone rules to the system. |\n\n### Enums\n\n|------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| [ZoneOffsetTransitionRule.TimeDefinition](../../../../reference/java/time/zone/ZoneOffsetTransitionRule.TimeDefinition.html) | A definition of the way a local time can be converted to the actual transition date-time. |\n\n### Exceptions\n\n|------------------------------------------------------------------------------------|------------------------------------------------------------|\n| [ZoneRulesException](../../../../reference/java/time/zone/ZoneRulesException.html) | Thrown to indicate a problem with time-zone configuration. |"]]