Class TimeZones
java.lang.Object
org.apache.commons.lang3.time.TimeZones
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TimeZonegetTimeZone(String id) Delegates toTimeZone.getTimeZone(String), on Java 25 and up, maps an ID if it's a key inZoneId.SHORT_IDS.static TimeZonetoTimeZone(TimeZone timeZone) Returns the given TimeZone if non-null, otherwiseTimeZone.getDefault().
-
Field Details
-
GMT_ID
-
GMT
-
-
Method Details
-
getTimeZone
Delegates toTimeZone.getTimeZone(String), on Java 25 and up, maps an ID if it's a key inZoneId.SHORT_IDS.On Java 25, calling
TimeZone.getTimeZone(String)with an ID inZoneId.SHORT_IDSwrites a message toSystem.errin the form:WARNING: Use of the three-letter time zone ID "the-short-id" is deprecated and it will be removed in a future release
You can disable mapping from
ZoneId.SHORT_IDSby setting the system property"TimeZones.mapShortIDs=false".- Parameters:
id- Same asTimeZone.getTimeZone(String).- Returns:
- Same as
TimeZone.getTimeZone(String). - Since:
- 3.20.0
-
toTimeZone
Returns the given TimeZone if non-null, otherwiseTimeZone.getDefault().- Parameters:
timeZone- a locale ornull.- Returns:
- the given locale if non-
null, otherwiseTimeZone.getDefault(). - Since:
- 3.13.0
-