Class TimeFormatter


  • public class TimeFormatter
    extends Object
    Formats time values into human-readable strings.
    Author:
    James Murty
    • Constructor Detail

      • TimeFormatter

        public TimeFormatter()
    • Method Detail

      • formatTime

        public String formatTime​(long seconds)
        Formats a seconds time value into a brief representation, such as 37 minutes. Unicode characters are used to represent 1/4, 1/2 and 3/4 fractions.
        Parameters:
        seconds - the number of seconds time value.
        Returns:
        a representation of the time.
      • formatTime

        public String formatTime​(long seconds,
                                 boolean useUnicodeChars)
        Formats a seconds time value into a brief representation, such as 37 minutes.
        Parameters:
        seconds - the number of seconds time value.
        useUnicodeChars - if true, special unicode characters are used to represent 1/4, 1/2 and 3/4 fractions. If false, the fractions are displayed in standard text.
        Returns:
        a representation of the time.