public class ISO8601Date extends Date
| Modifier and Type | Field and Description |
|---|---|
static int |
DAY_OF_MONTH_MASK |
static int |
DAY_OF_WEEK_MASK |
static int |
DAY_OF_YEAR_MASK |
static int |
HOUR_OF_DAY_MASK |
static int |
MILLISECOND_MASK |
static int |
MINUTE_MASK |
static int |
MONTH_MASK |
static int |
SECOND_MASK |
static int |
WEEK_OF_YEAR_MASK |
static int |
YEAR_MASK |
static int |
ZONE_OFFSET_MASK |
| Constructor and Description |
|---|
ISO8601Date() |
ISO8601Date(Calendar cal) |
ISO8601Date(Date date,
TimeZone timeZone) |
ISO8601Date(ISO8601Date date) |
ISO8601Date(long date) |
ISO8601Date(String date) |
ISO8601Date(String date,
TimeZone timeZone) |
| Modifier and Type | Method and Description |
|---|---|
static Calendar |
decode(CharSequence str)
Parse an ISO 8601 date into a
Calendar object. |
static Calendar |
getCalendar()
Get a
Calendar object in a suitable form for ISO 8601 dates. |
TimeZone |
getTimeZone() |
void |
setTime(long time) |
void |
setTimeZone(TimeZone timeZone) |
String |
toString() |
static String |
toString(Calendar cal)
Convert a
Calendar object to an ISO 8601 string. |
static String |
toString(Calendar cal,
boolean extended)
Convert a
Calendar object to an ISO 8601 string. |
static String |
toString(Calendar cal,
boolean extended,
int fields)
Convert a
Calendar object to an ISO 8601 string. |
static String |
toString(Date date) |
static String |
toString(Date date,
TimeZone timeZone) |
after, before, clone, compareTo, equals, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toInstant, toLocaleString, UTCpublic static final int YEAR_MASK
public static final int MONTH_MASK
public static final int WEEK_OF_YEAR_MASK
public static final int DAY_OF_MONTH_MASK
public static final int DAY_OF_YEAR_MASK
public static final int DAY_OF_WEEK_MASK
public static final int HOUR_OF_DAY_MASK
public static final int MINUTE_MASK
public static final int SECOND_MASK
public static final int MILLISECOND_MASK
public static final int ZONE_OFFSET_MASK
public ISO8601Date()
public ISO8601Date(long date)
public ISO8601Date(String date)
public ISO8601Date(Calendar cal)
public ISO8601Date(ISO8601Date date)
public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
public static Calendar getCalendar()
Calendar object in a suitable form for ISO 8601 dates.Calendar objectpublic static Calendar decode(CharSequence str)
Calendar object.str - the input date in CharSequence (e.g. String) formatCalendar object containing the date details from the inputIllegalArgumentException - if the input date is invalidpublic static String toString(Calendar cal)
Calendar object to an ISO 8601 string. This function outputs to the
string only those fields that are marked as having been set explicitly.
The "extended" format will be used, that is, date and time separators will be included.
public static String toString(Calendar cal, boolean extended)
Calendar object to an ISO 8601 string. This function outputs to the
string only those fields that are marked as having been set explicitly.public static String toString(Calendar cal, boolean extended, int fields)
Calendar object to an ISO 8601 string. This function outputs to the
string only those fields selected in a bit mask of field designators. Not all field
combinations are valid. The bit mask values are:
Copyright © 2020. All rights reserved.