TimeZones¶
Fields and constants¶
Methods¶
|
Gets the time zone using |
|
|
Returns the given TimeZone if non- |
- public static TimeZone getTimeZone(String id)[source]¶
Gets the time zone using
TimeZone.getTimeZone(String). On Java 25 and later, maps IDs found 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 as
TimeZone.getTimeZone(String).- Returns:
Same as
TimeZone.getTimeZone(String).- Since:
3.20.0
- public static TimeZone toTimeZone(TimeZone timeZone)[source]¶
Returns the given TimeZone if non-
null, otherwiseTimeZone.getDefault().- Parameters:
timeZone – A locale or
null.- Returns:
The given locale if non-
null, otherwiseTimeZone.getDefault().- Since:
3.13.0