Package org.opencms.gwt.client.util
Class CmsDateTimeUtil
- java.lang.Object
-
- org.opencms.gwt.client.util.CmsDateTimeUtil
-
public final class CmsDateTimeUtil extends java.lang.Object
Client side implementation forCmsDateUtil
.- Since:
- 8.0.0
- See Also:
CmsDateUtil
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsDateTimeUtil.Format
The standard formats.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getDate(java.util.Date date, CmsDateTimeUtil.Format format)
Returns a formated date String from a Date value, the formatting based on the provided options.static java.lang.String
getDateShort(long time)
Returns a formated date String form a timestamp value, the formatting based on the OpenCms system default locale and theCmsDateTimeUtil.Format.SHORT
date format.static java.lang.String
getDateTime(java.util.Date date, CmsDateTimeUtil.Format format)
Returns a formated date and time String from a Date value, the formatting based on the provided options.static java.lang.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 theCmsDateTimeUtil.Format.SHORT
date format.static java.lang.String
getTime(java.util.Date date, CmsDateTimeUtil.Format format)
Returns a formated time String from a Date value, the formatting based on the provided options.
-
-
-
Method Detail
-
getDate
public static java.lang.String getDate(java.util.Date date, CmsDateTimeUtil.Format format)
Returns a formated date String from a Date value, the formatting based on the provided options.- Parameters:
date
- the Date object to format as Stringformat
- the format to use- Returns:
- the formatted date
-
getDateShort
public static java.lang.String getDateShort(long time)
Returns a formated date String form a timestamp value, the formatting based on the OpenCms system default locale and theCmsDateTimeUtil.Format.SHORT
date format.- Parameters:
time
- the time value to format as date- Returns:
- the formatted date
-
getDateTime
public static java.lang.String getDateTime(java.util.Date date, CmsDateTimeUtil.Format format)
Returns a formated date and time String from a Date value, the formatting based on the provided options.- Parameters:
date
- the Date object to format as Stringformat
- the format to use, seeCmsDateTimeUtil.Format
for possible values- Returns:
- the formatted date
-
getDateTimeShort
public static java.lang.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 theCmsDateTimeUtil.Format.SHORT
date format.- Parameters:
time
- the time value to format as date- Returns:
- the formatted date
-
getTime
public static java.lang.String getTime(java.util.Date date, CmsDateTimeUtil.Format format)
Returns a formated time String from a Date value, the formatting based on the provided options.- Parameters:
date
- the Date object to format as Stringformat
- the format to use- Returns:
- the formatted time
-
-