Package de.stefanfrings.utils
Class ISO8601Calendar
java.lang.Object
java.util.Calendar
java.util.GregorianCalendar
de.stefanfrings.utils.ISO8601Calendar
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Calendar>
ISO 8601 date/time encoder and decoder.
- Author:
- Stefan Frings, http://stefanfrings.de/javautils
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.Calendar
Calendar.Builder -
Field Summary
Fields inherited from class java.util.GregorianCalendar
AD, BCFields inherited from class java.util.Calendar
ALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, LONG_FORMAT, LONG_STANDALONE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NARROW_FORMAT, NARROW_STANDALONE, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SHORT_FORMAT, SHORT_STANDALONE, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET -
Constructor Summary
ConstructorsConstructorDescriptionISO8601Calendar(String isodate) Constructor, parses date string.ISO8601Calendar(Date date, TimeZone tz) Constructor, sets the internal value to the given date/time. -
Method Summary
Methods inherited from class java.util.GregorianCalendar
add, clone, computeFields, computeTime, equals, from, getActualMaximum, getActualMinimum, getCalendarType, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, getWeeksInWeekYear, getWeekYear, hashCode, isLeapYear, isWeekDateSupported, roll, roll, setGregorianChange, setTimeZone, setWeekDate, toZonedDateTimeMethods inherited from class java.util.Calendar
after, before, clear, clear, compareTo, complete, get, getAvailableCalendarTypes, getAvailableLocales, getDisplayName, getDisplayNames, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toInstant
-
Constructor Details
-
ISO8601Calendar
Constructor, sets the internal value to the given date/time.- Parameters:
date- Datetz- optional timezone, default if UTC.
-
ISO8601Calendar
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 Details