Interface DateFormatter

  • All Known Implementing Classes:
    YMDDateFormatter

    public interface DateFormatter
    Abstract formatter for dates. Differs from DateFormat in that it provides withLocale and withTimeZone methods.
    • Method Detail

      • format

        String format​(Date date)
        Format the date, provided as a java Date object.
        Parameters:
        date - the date
        Returns:
        the formatted time
      • format

        String format​(long date)
        Format the date, provided as milliseconds.
        Parameters:
        date - the date in milliseconds
        Returns:
        the formatted time
      • withLocale

        DateFormatter withLocale​(String localeName)
        Returns a new DateFormatter that uses data for a new locale.
        Parameters:
        locale - the new locale to use
        Returns:
        a new formatter for the given locale
      • withTimeZone

        DateFormatter withTimeZone​(TimeZone tz)
        Returns a new DateFormatter that uses the new time zone.
        Parameters:
        tz - the new time zone
        Returns:
        a new formatter for the given time zone