Package com.day.util

Class TimeZoneUtil


  • public class TimeZoneUtil
    extends java.lang.Object
    The TimeZoneUtil class provides convenience methods for handling time zones in Java.
    Since:
    echidna Audience wad
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeZoneUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.TimeZone[] getAvailableZones()
      Returns an array of TimeZone objects sorted in ascending order by their UTC time offset.
      static java.lang.String getDisplayName​(java.util.TimeZone zone)
      Formats the passed TimeZone object to a String representation:
      static java.util.TimeZone getServerTimeZone()
      Returns the TimeZone of the Communique server.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimeZoneUtil

        public TimeZoneUtil()
    • Method Detail

      • getAvailableZones

        public static java.util.TimeZone[] getAvailableZones()
        Returns an array of TimeZone objects sorted in ascending order by their UTC time offset.
        Returns:
        a sorted array of TimeZone objects.
      • getServerTimeZone

        public static java.util.TimeZone getServerTimeZone()
        Returns the TimeZone of the Communique server.
        Returns:
        the TimeZone of the Communique server.
      • getDisplayName

        public static java.lang.String getDisplayName​(java.util.TimeZone zone)
        Formats the passed TimeZone object to a String representation:

        [<UTC offset>] <time zone name> (<short name>)

        Example: [UTC+01.00] Europe/Berlin (CEST)

        Parameters:
        zone - The TimeZone to format
        Returns:
        a String representation of the passed TimeZone.