Class TimeFormatter

java.lang.Object
org.jets3t.service.utils.TimeFormatter

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

    • TimeFormatter

      public TimeFormatter()
    • TimeFormatter

      public TimeFormatter(String hourSuffix, String hoursSuffix, String minuteSuffix, String minutesSuffix, String secondSuffix, String secondsSuffix)
  • Method Details

    • 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.