Class ISO8601Calendar

    • Constructor Detail

      • ISO8601Calendar

        public ISO8601Calendar​(Date date,
                               TimeZone tz)
        Constructor, sets the internal value to the given date/time.
        Parameters:
        date - Date
        tz - optional timezone, default if UTC.
      • ISO8601Calendar

        public ISO8601Calendar​(String isodate)
                        throws NumberFormatException
        Constructor, parses date string.

        The String format may be one of

        • YYYY-MM-DDThh:mm:ss.sZ (UTC, timetone offset = 0)
        • YYYY-MM-DDThh:mm:ss.s+hh:mm
        • YYYY-MM-DDThh:mm:ss.s-hh:mm

        Parts from the right side (e.g. the whole time or the seconds) can be left out.

        Parameters:
        isodate - Date string in ISO 8601 format.
        Throws:
        NumberFormatException - If the date format is invalid.
    • Method Detail

      • toString

        public String toString()
        Return the internal value as ISO 8601 date string in format YYYY-MM-DDThh:mm:ss.s+hh:mm
        Overrides:
        toString in class Calendar
        Returns:
        a string representing the date