Class DateUtils

java.lang.Object
com.webmethods.caf.faces.context.DateUtils

public class DateUtils extends Object
Time and date utilities.
  • Field Details

  • Constructor Details

    • DateUtils

      public DateUtils()
  • Method Details

    • shutdown

      public static void shutdown()
    • getUserLocale

      public static Locale getUserLocale(FacesContext context)
      Current user's preferred locale if it matches one of the installed language packs. Otherwise, returns the default locale.
    • getUserTimeZone

      public static TimeZone getUserTimeZone(FacesContext context)
      Current user's preferred time-zone.
    • getUserCalendar

      public static Calendar getUserCalendar(FacesContext context)
      Current user's preferred calendar.
    • getUserDateTimeFormat

      public static DateFormat getUserDateTimeFormat(FacesContext context)
      Current user's preferred date-time format.
    • getUserDateFormat

      public static DateFormat getUserDateFormat(FacesContext context)
      Current user's preferred date format.
    • getUserTimeFormat

      public static DateFormat getUserTimeFormat(FacesContext context)
      Current user's preferred time format.
    • getUserInputDateTimeFormat

      public static DateFormat getUserInputDateTimeFormat(FacesContext context)
      Current user's preferred format for inputing date-time.
    • getUserInputDateFormat

      public static DateFormat getUserInputDateFormat(FacesContext context)
      Current user's preferred format for inputing date.
    • getUserInputTimeFormat

      public static DateFormat getUserInputTimeFormat(FacesContext context)
      Current user's preferred format for inputing time.
    • getUserCustomFormat

      public static DateFormat getUserCustomFormat(FacesContext context, String pattern)
      Current user's preferred locale & time-zone aware format for custom date-time pattern.
    • getUserInputDateTimePattern

      public static String getUserInputDateTimePattern(FacesContext context)
      Current user's preferred pattern for inputing date-time.
    • getUserInputDatePattern

      public static String getUserInputDatePattern(FacesContext context)
      Current user's preferred pattern for inputing date.
    • getUserInputTimePattern

      public static String getUserInputTimePattern(FacesContext context)
      Current user's preferred pattern for inputing time.
    • getFormattedDate

      public static String getFormattedDate(FacesContext context, Date date, String datePattern)
      Format the given date with the specified format
    • getFormattedTime

      public static String getFormattedTime(FacesContext context, Date date, String timePattern, String timezoneID)
      Format the given date with the specified format
    • getTimeZone

      public static TimeZone getTimeZone(FacesContext context, UIComponent component)
      Time-zone to display date.