Class TimeZoneUtil

  • All Implemented Interfaces:
    java.io.Serializable

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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toJSON​(java.time.ZoneId zoneId, java.util.Locale locale)
      Returns a JSON string of the specified zoneId and Locale, which is used in com.google.gwt.i18n.client.TimeZone.createTimeZone(String).
      static java.lang.String toJSON​(java.time.ZoneId zoneId, java.util.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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toJSON

        public static java.lang.String toJSON​(java.time.ZoneId zoneId,
                                              java.util.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 java.lang.String toJSON​(java.time.ZoneId zoneId,
                                              java.util.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