Class CmsDateTimeUtil

java.lang.Object
org.opencms.gwt.client.util.CmsDateTimeUtil

public final class CmsDateTimeUtil extends Object
Client side implementation for CmsDateUtil.

Since:
8.0.0
See Also:
  • CmsDateUtil
  • Method Details

    • getDate

      public static String getDate(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 String
      format - the format to use
      Returns:
      the formatted date
    • getDateShort

      public 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 CmsDateTimeUtil.Format.SHORT date format.

      Parameters:
      time - the time value to format as date
      Returns:
      the formatted date
    • getDateTime

      public static String getDateTime(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 String
      format - the format to use, see CmsDateTimeUtil.Format for possible values
      Returns:
      the formatted date
    • getDateTimeShort

      public 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 CmsDateTimeUtil.Format.SHORT date format.

      Parameters:
      time - the time value to format as date
      Returns:
      the formatted date
    • getTime

      public static String getTime(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 String
      format - the format to use
      Returns:
      the formatted time