Package com.day.util

Class TimeZoneUtil


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

      • TimeZoneUtil

        public TimeZoneUtil()
    • Method Detail

      • getAvailableZones

        public static 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 TimeZone getServerTimeZone()
        Returns the TimeZone of the Communique server.
        Returns:
        the TimeZone of the Communique server.
      • getDisplayName

        public static String getDisplayName​(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.