Interface DateFormatter

  • All Implemented Interfaces:

    
    public interface DateFormatter
    
                        

    An interface that allows to format date-time objects as strings.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String formatDate(Date date) Formats the given date as a String.
      abstract String formatTime(Date date) Formats the given time as a String.
      abstract String formatRelativeTime(Date date) Formats the given date as a relative time string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • formatDate

         abstract String formatDate(Date date)

        Formats the given date as a String.

        Parameters:
        date - The Date to format as a String.
        Returns:

        The formatted date-time string.

      • formatTime

         abstract String formatTime(Date date)

        Formats the given time as a String.

        Parameters:
        date - The Date object to format as a String.
        Returns:

        The formatted time string.

      • formatRelativeTime

         abstract String formatRelativeTime(Date date)

        Formats the given date as a relative time string.

        Parameters:
        date - The Date to format as a relative time string.
        Returns:

        The formatted relative time string.