|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.cnes.sitools.util.DateUtils
public final class DateUtils
Custom DateUtils class for SITools2. Created from the DateUtils from Restlet 2.0.5
Field Summary | |
---|---|
static java.lang.String |
FORMAT_ISO_8601_WITHOUT_TIME_ZONE
ISO_8601 format without time zone |
static java.lang.String |
SITOOLS_DATE_FORMAT
Default date format for date exchange between the server and the client in all the Sitools2 application |
static java.lang.String |
SITOOLS_TIME_FORMAT
Default date format for date exchange between the server and the client in all the Sitools2 application |
Method Summary | |
---|---|
static java.util.Date |
add(java.util.Date date,
int field,
int amount)
Adds or subtracts the specified amount of time to the given calendar field, based on the calendar's rules. |
static java.lang.String |
format(java.util.Date date)
Formats a Date according to the default date format. |
static java.lang.String |
format(java.util.Date date,
java.lang.String format)
Formats a Date according to the first format in the array. |
static java.lang.String |
formatTime(java.util.Date date)
Formats a Date according to the default date format. |
static java.util.Date |
parse(java.lang.String date)
Parses a formatted date into a Date object with the default date format. |
static java.util.Date |
parse(java.lang.String date,
java.lang.String format)
Parses a formatted date into a Date object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SITOOLS_DATE_FORMAT
public static final java.lang.String SITOOLS_TIME_FORMAT
public static final java.lang.String FORMAT_ISO_8601_WITHOUT_TIME_ZONE
Method Detail |
---|
public static java.lang.String format(java.util.Date date)
date
- The date to format.
public static java.lang.String formatTime(java.util.Date date)
date
- The date to format.
public static java.lang.String format(java.util.Date date, java.lang.String format)
date
- The date to format.format
- The date format to use.
public static java.util.Date parse(java.lang.String date) throws java.text.ParseException
date
- The date to parse.
java.text.ParseException
- if there is an error while parsing the datepublic static java.util.Date parse(java.lang.String date, java.lang.String format) throws java.text.ParseException
An IllegalArgumentException is raised when date is empty or null
date
- The date to parse.format
- The format of the date string
java.text.ParseException
- if there is an error while parsing the datepublic static java.util.Date add(java.util.Date date, int field, int amount)
date
- the Datefield
- the calendar field. A constant of the class Calendar
amount
- the amount of date or time to be added to the field.
Date
corresponding to date + minutes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |