Class XDateFormatter

java.lang.Object
de.xima.fc.utils.XDateFormatter

public class XDateFormatter extends Object
Formatter for Dates
Author:
XIMA MEDIA GmbH
  • Method Details

    • newFormatter

      @Deprecated public static final XDateFormatter newFormatter(Locale locale)
      Get a new instance of an XDateFormatter
      Parameters:
      locale - Locale to be used. If null the default Locale will be used
      Returns:
      XDateFormatter
    • newFormatter

      public static final XDateFormatter newFormatter(Locale locale, ZoneId zone)
      Get a new instance of an XDateFormatter
      Parameters:
      locale - Locale to be used. If null the default Locale will be used
      zone - Time zone to use for formatting.
      Returns:
      XDateFormatter
    • format

      public String format(Date date)
      Converts the given Date to a LONG date String representation
      Parameters:
      date - Date to be converted to a String
      Returns:
      String representation of the given date, formatted by the system's default format for the configure locale. If an error occurs while formatting the date will be returned in default format.
    • format

      public String format(Date date, String pattern)
      Converts the given Date to a String with the given format pattern
      Parameters:
      date - Date to be converted to a String
      pattern - String format pattern
      Returns:
      String representation of the given date, formatted by the given pattern and locale. If an error occurs while formatting the date will be returned in default format