Class TimeZoneUtil

  • All Implemented Interfaces:
    Serializable

    public final class TimeZoneUtil
    extends Object
    implements Serializable
    Utilities related to com.google.gwt.i18n.client.TimeZone.
    Since:
    8.2
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Method Detail

      • toJSON

        public static String toJSON​(ZoneId zoneId,
                                    Locale locale)
        Returns a JSON string of the specified zoneId and Locale, which is used in com.google.gwt.i18n.client.TimeZone.createTimeZone(String). This method calculates the JSON string from the year 1980 until 20 years into the future from the current date.
        Parameters:
        zoneId - the ZoneId to get the daylight transitions from
        locale - the locale used to determine the short name of the time zone
        Returns:
        the encoded string
        See Also:
        toJSON(ZoneId, Locale, int, int)
      • toJSON

        public static String toJSON​(ZoneId zoneId,
                                    Locale locale,
                                    int startYear,
                                    int endYear)
        Returns a JSON string of the specified zoneId and Locale, which is used in com.google.gwt.i18n.client.TimeZone.createTimeZone(String). This method calculates the JSON string from startYear until startYear, both inclusive.
        Parameters:
        zoneId - the ZoneId to get the daylight transitions from
        locale - the locale used to determine the short name of the time zone
        startYear - the start year of DST transitions
        endYear - the end year of DST transitions
        Returns:
        the encoded string
        Since:
        8.11