Class TimeParser

java.lang.Object
com.jackmeng.halcyoninae.halcyon.utils.TimeParser

public final class TimeParser extends Object
A utility class that provides methods for parsing time.
Since:
3.0
Author:
Jack Meng
  • Constructor Details

    • TimeParser

      private TimeParser()
  • Method Details

    • getLogCurrentTime

      public static String getLogCurrentTime()
      Returns a string representation of the time in the format of yyyy-MM-dd HH:mm:ss This time is taken from System.currentTimeMillis().
      Returns:
      A string representation of the time in the format of yyyy-MM-dd HH:mm:ss
    • fromSeconds

      public static String fromSeconds(int seconds)
      Converts the seconds into HH:MM:SS format.
      Parameters:
      seconds - The seconds to be converted
      Returns:
      A string representation of the time in the format of HH:MM:SS
    • fromMillis

      public static String fromMillis(long millis)
      Converts a time of milliseconds into a String form "HH:MM:SS" where H represents HOURS, M represents MINUTES, and S represents SECONDS
      Parameters:
      millis - A primitive long representing milliseconds
      Returns:
      A String representing the long milliseconds in a pretty format
    • fromRealMillis

      public static String fromRealMillis(long millis)
      Parameters:
      millis -
      Returns:
      String