|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.util.CmsDateUtil
public final class CmsDateUtil
Utilities to get and set formated dates in OpenCms.
| Field Summary | |
|---|---|
protected static TimeZone |
GMT_TIMEZONE
The "GMT" time zone, used when formatting http headers. |
protected static DateFormat |
HEADER_DEFAULT
The default format to use when formatting http headers. |
protected static DateFormat |
OLD_COOKIE
The default format to use when formatting old cookies. |
| Method Summary | |
|---|---|
static String |
getDate(Date date,
int format,
Locale locale)
Returns a formated date String from a Date value, the formatting based on the provided options. |
static String |
getDateShort(long time)
Returns a formated date String form a timestamp value, the formatting based on the OpenCms system default locale and the DateFormat.SHORT date format. |
static String |
getDateTime(Date date,
int format,
Locale locale)
Returns a formated date and time String from a Date value, the formatting based on the provided options. |
static String |
getDateTimeShort(long time)
Returns a formated date and time String form a timestamp value, the formatting based on the OpenCms system default locale and the DateFormat.SHORT date format. |
static int |
getDaysPassedSince(Date dateLastModified)
Returns the number of days passed since a specific date. |
static String |
getHeaderDate(long time)
Returns a formated date and time String form a timestamp value based on the HTTP-Header date format. |
static String |
getOldCookieDate(long time)
Returns a formated date and time String form a timestamp value based on the (old) Netscape cookie date format. |
static long |
parseDate(int year,
int month,
int date)
Returns the long value of a date created by the given integer values. |
static long |
parseHeaderDate(String timestamp)
Parses a formated date and time string in HTTP-Header date format and returns the time value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final TimeZone GMT_TIMEZONE
protected static final DateFormat HEADER_DEFAULT
protected static final DateFormat OLD_COOKIE
| Method Detail |
|---|
public static String getDate(Date date,
int format,
Locale locale)
date - the Date object to format as Stringformat - the format to use, see DateFormat for possible valueslocale - the locale to use
public static String getDateShort(long time)
DateFormat.SHORT date format.
time - the time value to format as date
public static String getDateTime(Date date,
int format,
Locale locale)
date - the Date object to format as Stringformat - the format to use, see DateFormat for possible valueslocale - the locale to use
public static String getDateTimeShort(long time)
DateFormat.SHORT date format.
time - the time value to format as date
public static int getDaysPassedSince(Date dateLastModified)
dateLastModified - the date to compute the passed days from
public static String getHeaderDate(long time)
time - the time value to format as date
public static String getOldCookieDate(long time)
time - the time value to format as date
public static long parseDate(int year,
int month,
int date)
year - the integer value of yearmonth - the integer value of monthdate - the integer value of date
public static long parseHeaderDate(String timestamp)
throws ParseException
timestamp - the timestamp in HTTP-Header date format
ParseException - if parsing fails
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||