Class Time


  • public class Time
    extends java.lang.Object
    Time Utility
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Date getDate()
      Return current time.
      static long getUnixTime()
      Return current unix time.
      static java.lang.String humanizeDuration​(double d)
      Transform time (in ms) to a human-readable format.
      • Methods inherited from class java.lang.Object

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

      • getDate

        public static java.util.Date getDate()
        Return current time.
        Returns:
        {Date}
      • getUnixTime

        public static long getUnixTime()
        Return current unix time.
        Returns:
        {long}
      • humanizeDuration

        public static java.lang.String humanizeDuration​(double d)
        Transform time (in ms) to a human-readable format. E.g. 1100 => 1.1s. 60s => 1min. .001 => 10μs.
        Parameters:
        d - duration in milliseconds
        Returns:
        {String} humanized approximation of time