org.apache.commons.lang3.time

## Class TimeZones

- java.lang.Object
- - org.apache.commons.lang3.time.TimeZones

-     public class TimeZones
      extends Object

  Helps to deal with `TimeZone`s.
  Since:
    3.7

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TimeZone` | `GMT` The GMT time zone.
    `static String` | `GMT_ID` A public version of `TimeZone`'s package private `GMT_ID` field.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TimeZone` | `toTimeZone(TimeZone timeZone)` Returns the given TimeZone if non-`null`, otherwise `TimeZone.getDefault()`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### GMT_ID

          public static final String GMT_ID

      A public version of `TimeZone`'s package private `GMT_ID` field.
      See Also:
        Constant Field Values

    - #### GMT

          public static final TimeZone GMT

      The GMT time zone.
      Since:
        3.13.0

  - ### Method Detail

    - #### toTimeZone

          public static TimeZone toTimeZone(TimeZone timeZone)

      Returns the given TimeZone if non-`null`, otherwise `TimeZone.getDefault()`.
      Parameters:
        `timeZone` - a locale or `null`.
      Returns:
        the given locale if non-`null`, otherwise `TimeZone.getDefault()`.
      Since:
        3.13.0

Copyright © 2001–2023 The Apache Software Foundation. All rights reserved.