public class JavaDate
extends java.lang.Object
Constructor and Description |
---|
JavaDate() |
Modifier and Type | Method and Description |
---|---|
static java.util.Calendar |
addDaysTo(java.util.Calendar date,
int days)
Returns a new Calendar that is the result of adding the
specified number of days to the specified date.
|
static java.util.Calendar |
addDurationTo(java.util.Calendar date,
javax.xml.datatype.Duration duration)
Returns a new Calendar that is the result of adding the
specified XML Duration to the specified date.
|
static java.util.Calendar |
addHoursTo(java.util.Calendar date,
long hours)
Returns a new Calendar that is the result of adding the
specified number of hours to the specified date.
|
static java.util.Calendar |
addMillisecondsTo(java.util.Calendar date,
long milliseconds)
Returns a new Calendar that is the result of adding the
specified number of milliseconds to the specified date.
|
static java.util.Calendar |
addMinutesTo(java.util.Calendar date,
long minutes)
Returns a new Calendar that is the result of adding the
specified number of minutes to the specified date.
|
static java.util.Calendar |
addMonthsTo(java.util.Calendar date,
int months)
Returns a new Calendar that is the result of adding the
specified number of months to the specified date.
|
static java.util.Calendar |
addSecondsTo(java.util.Calendar date,
long seconds)
Returns a new Calendar that is the result of adding the
specified number of seconds to the specified date.
|
static java.util.Calendar |
addWeeksTo(java.util.Calendar date,
int weeks)
Returns a new Calendar that is the result of adding the
specified number of weeks to the specified date.
|
static java.util.Calendar |
addYearsTo(java.util.Calendar date,
int years)
Returns a new Calendar that is the result of adding the
specified number of years to the specified date.
|
static java.util.Calendar |
fromDateString(java.lang.String dateString)
Creates a Calendar instance for the specified extended ISO 8601 date.
|
static java.util.Calendar |
fromDateTimeString(java.lang.String datetimeString)
Creates a Calendar instance for the specified extended ISO 8601 date and time.
|
static java.util.Calendar |
fromTimeString(java.lang.String timeString)
Creates a Calendar instance for the specified extended ISO 8601 time.
|
static java.util.Calendar |
subtractDaysFrom(java.util.Calendar date,
int days)
Returns a new Calendar that is the result of subtracting the
specified number of days from the specified date.
|
static java.util.Calendar |
subtractDurationFrom(java.util.Calendar date,
javax.xml.datatype.Duration duration)
Returns a new Calendar that is the result of subtracting the
specified duration from the specified date.
|
static java.util.Calendar |
subtractHoursFrom(java.util.Calendar date,
long hours)
Returns a new Calendar that is the result of subtracting the
specified number of hours from the specified date.
|
static java.util.Calendar |
subtractMillisecondsFrom(java.util.Calendar date,
long milliseconds)
Returns a new Calendar that is the result of subtracting the
specified number of milliseconds from the specified date.
|
static java.util.Calendar |
subtractMinutesFrom(java.util.Calendar date,
long minutes)
Returns a new Calendar that is the result of subtracting the
specified number of minutes from the specified date.
|
static java.util.Calendar |
subtractMonthsFrom(java.util.Calendar date,
int months)
Returns a new Calendar that is the result of subtracting the
specified number of months from the date.
|
static java.util.Calendar |
subtractSecondsFrom(java.util.Calendar date,
long seconds)
Returns a new Calendar that is the result of subtracting the
specified number of seconds from the specified date.
|
static java.util.Calendar |
subtractWeeksFrom(java.util.Calendar date,
int weeks)
Returns a new Calendar that is the result of subtracting the
specified number of weeks from the specified date.
|
static java.util.Calendar |
subtractYearsFrom(java.util.Calendar date,
int years)
Returns a new Calendar that is the result of subtracting the
specified number of years from the specified date.
|
static java.lang.String |
toDateString(java.util.Calendar date)
Return the ISO 8601 representation of the specified date.
|
static java.lang.String |
toDateTimeString(java.util.Calendar date)
Return the ISO 8601 representation of the specified date and time.
|
static java.lang.String |
toDateTimeTzString(java.util.Calendar date)
Return the extended ISO 8601 representation of the specified date and time.
|
static java.lang.String |
toDateTzString(java.util.Calendar date)
Return the extended ISO 8601 representation of the specified date.
|
static java.lang.String |
toTimeString(java.util.Calendar time)
Return the ISO 8601 representation of the specified time.
|
static java.lang.String |
toTimeTzString(java.util.Calendar time)
Return the extended ISO 8601 representation of the specified time.
|
public static java.util.Calendar addYearsTo(java.util.Calendar date, int years)
date
- years
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addMonthsTo(java.util.Calendar date, int months)
date
- months
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addWeeksTo(java.util.Calendar date, int weeks)
date
- weeks
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addDaysTo(java.util.Calendar date, int days)
date
- days
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addHoursTo(java.util.Calendar date, long hours)
date
- hours
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addMinutesTo(java.util.Calendar date, long minutes)
date
- minutes
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addSecondsTo(java.util.Calendar date, long seconds)
date
- seconds
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addMillisecondsTo(java.util.Calendar date, long milliseconds)
date
- milliseconds
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar addDurationTo(java.util.Calendar date, javax.xml.datatype.Duration duration)
date
- duration
- java.lang.NullPointerException
- if either parameter is null.public static java.util.Calendar subtractYearsFrom(java.util.Calendar date, int years)
date
- years
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractMonthsFrom(java.util.Calendar date, int months)
date
- months
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractWeeksFrom(java.util.Calendar date, int weeks)
date
- weeks
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractDaysFrom(java.util.Calendar date, int days)
date
- days
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractHoursFrom(java.util.Calendar date, long hours)
date
- hours
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractMinutesFrom(java.util.Calendar date, long minutes)
date
- minutes
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractSecondsFrom(java.util.Calendar date, long seconds)
date
- seconds
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractMillisecondsFrom(java.util.Calendar date, long milliseconds)
date
- milliseconds
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar subtractDurationFrom(java.util.Calendar date, javax.xml.datatype.Duration duration)
date
- duration
- java.lang.NullPointerException
- if the date parameter is null.public static java.util.Calendar fromDateString(java.lang.String dateString) throws java.lang.IllegalArgumentException
dateString
- the ISO 8601 representation of a date.java.lang.IllegalArgumentException
- if an error occurs parsing the date
string.public static java.util.Calendar fromTimeString(java.lang.String timeString) throws java.lang.IllegalArgumentException
timeString
- the extended ISO 8601 representation of a time.java.lang.IllegalArgumentException
- if an error occurs parsing the date
string.public static java.util.Calendar fromDateTimeString(java.lang.String datetimeString) throws java.lang.IllegalArgumentException
datetimeString
- the ISO 8601 representation of a date and time.java.lang.IllegalArgumentException
- if an error occurs parsing the date
string.public static java.lang.String toDateString(java.util.Calendar date)
date
- the date to format.public static java.lang.String toDateTzString(java.util.Calendar date)
date
- the date to format.public static java.lang.String toDateTimeString(java.util.Calendar date)
date
- the date/time to format.public static java.lang.String toDateTimeTzString(java.util.Calendar date)
date
- the date/time to format.public static java.lang.String toTimeString(java.util.Calendar time)
time
- the time to format.public static java.lang.String toTimeTzString(java.util.Calendar time)
time
- the time to format.