Class TimeUtil

java.lang.Object
com.plotsquared.core.util.TimeUtil

public final class TimeUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NonNull String
    secToTime​(@org.checkerframework.checker.index.qual.NonNegative long time)
    Format seconds into a string with the format #y #w #d #h #s
    static @org.checkerframework.checker.index.qual.NonNegative long
    timeToSec​(@NonNull String string)
    Parse a time string back into time

    Methods inherited from class java.lang.Object

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

    • secToTime

      public static @NonNull String secToTime(@org.checkerframework.checker.index.qual.NonNegative long time)
      Format seconds into a string with the format #y #w #d #h #s
      Parameters:
      time - Time to format
      Returns:
      Formatted string
    • timeToSec

      public static @org.checkerframework.checker.index.qual.NonNegative long timeToSec(@NonNull String string)
      Parse a time string back into time
      Parameters:
      string - String to parse
      Returns:
      Parsed time