com.vaadin.util.

Class TimeZoneUtil

    • 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 TimeZone.createTimeZone(String). This method calculates the JSON string from the year until 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 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