Class DateUtils

java.lang.Object
com.atlassian.crowd.core.tiny.DateUtils

public class DateUtils extends Object
  • Constructor Details

  • Method Details

    • getDurationPrettySecondsResolution

      public static String getDurationPrettySecondsResolution(long numSecs, ResourceBundle resourceBundle)
      Converts a number of seconds into a pretty formatted data string. The resolution is in seconds.

      So for example 76 becomes '1 minute, 16 seconds', while 42 becomes '42 seconds'

      Parameters:
      numSecs - the number of seconds in the duration
      resourceBundle - a resouce bundle for i18n
      Returns:
      a string in readable pretty duration format, using second resolution
    • getDurationPretty

      public static String getDurationPretty(long numSecs, Function<String,String> i18nResolver, boolean secondsResolution)
    • formatDurationPretty

      public String formatDurationPretty(long l)
      This is used by the Velocity templates as a bean
      Parameters:
      l - a duration in seconds
      Returns:
      a pretty formatted version of the duration