|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.util.DateUtil
public class DateUtil
Util to format and parse dates.
Field Summary | |
---|---|
static java.lang.String |
FORMAT_DATE_LONG
|
static java.lang.String |
FORMAT_DATE_MEDIUM
|
static java.lang.String |
FORMAT_DATE_SHORT
|
static java.lang.String |
FORMAT_DATETIME_LONG
|
static java.lang.String |
FORMAT_DATETIME_MEDIUM
|
static java.lang.String |
FORMAT_DATETIME_SHORT
|
static java.lang.String |
FORMAT_DEFAULTPATTERN
Default date format. |
static java.lang.String |
FORMAT_TIME_LONG
|
static java.lang.String |
FORMAT_TIME_MEDIUM
|
static java.lang.String |
FORMAT_TIME_SHORT
|
static java.util.TimeZone |
UTC_TIME_ZONE
|
static java.lang.String |
YYYY_MM_DD
|
static java.lang.String |
YYYY_MM_DD_T_HH_MM_SS
|
Method Summary | |
---|---|
static java.lang.String |
format(java.util.Date date,
java.lang.String formatPattern)
Supports implicit formats like: date, date long, datetime, dateime long, time and time long. |
static java.lang.String |
format(java.util.Date date,
java.lang.String formatPattern,
java.util.Locale locale)
|
static java.lang.String |
formatDate(java.lang.Object val)
Uses the current locale (user) to format the date. |
static java.lang.String |
formatDateTime(java.lang.Object val)
Uses the current locale (user) to format the date and time. |
static java.util.Calendar |
getCurrentUTCCalendar()
Get UTC Calendar for current time. |
static java.util.Calendar |
getLocalCalendarFromUTC(java.util.Calendar utc)
Get the equivalent UTC calendar to a local calendar. |
static java.util.Calendar |
getUTCCalendarFromDialogString(java.lang.String dateString)
Convert a string date from a dialog date to a UTC calendar ready to be stored in the repository. |
static java.util.Calendar |
getUTCCalendarFromLocalDate(java.util.Date date)
Convert a local date time to a UTC calendar. |
static java.util.Date |
parseDate(java.lang.String dateStr)
Uses the current locale (user) to parse the date. |
static java.util.Date |
parseDateTime(java.lang.String dateStr)
Uses the current locale (user) to parse the date and time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FORMAT_DATE_SHORT
public static final java.lang.String FORMAT_DATE_MEDIUM
public static final java.lang.String FORMAT_DATE_LONG
public static final java.lang.String FORMAT_DATETIME_SHORT
public static final java.lang.String FORMAT_DATETIME_MEDIUM
public static final java.lang.String FORMAT_DATETIME_LONG
public static final java.lang.String FORMAT_TIME_SHORT
public static final java.lang.String FORMAT_TIME_MEDIUM
public static final java.lang.String FORMAT_TIME_LONG
public static final java.lang.String FORMAT_DEFAULTPATTERN
public static final java.lang.String YYYY_MM_DD
public static final java.lang.String YYYY_MM_DD_T_HH_MM_SS
public static final java.util.TimeZone UTC_TIME_ZONE
Method Detail |
---|
public static java.lang.String format(java.util.Date date, java.lang.String formatPattern)
public static java.lang.String format(java.util.Date date, java.lang.String formatPattern, java.util.Locale locale)
public static java.lang.String formatDateTime(java.lang.Object val)
val
- Date or Calendar
public static java.lang.String formatDate(java.lang.Object val)
val
- Date or Calendar
public static java.util.Date parseDateTime(java.lang.String dateStr) throws java.text.ParseException
val
- Date or Calendar
java.text.ParseException
public static java.util.Date parseDate(java.lang.String dateStr) throws java.text.ParseException
val
- Date or Calendar
java.text.ParseException
public static java.util.Calendar getLocalCalendarFromUTC(java.util.Calendar utc)
public static java.util.Calendar getUTCCalendarFromDialogString(java.lang.String dateString) throws java.text.ParseException
java.text.ParseException
public static java.util.Calendar getUTCCalendarFromLocalDate(java.util.Date date)
public static java.util.Calendar getCurrentUTCCalendar()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |