Class TimeParser
java.lang.Object
com.jackmeng.halcyoninae.halcyon.utils.TimeParser
A utility class that provides methods for parsing time.
- Since:
- 3.0
- Author:
- Jack Meng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 SECONDSstatic String
fromRealMillis
(long millis) static String
fromSeconds
(int seconds) Converts the seconds intoHH:MM:SS
format.static String
Returns a string representation of the time in the format ofyyyy-MM-dd HH:mm:ss
This time is taken fromSystem.currentTimeMillis()
.
-
Constructor Details
-
TimeParser
private TimeParser()
-
-
Method Details
-
getLogCurrentTime
Returns a string representation of the time in the format ofyyyy-MM-dd HH:mm:ss
This time is taken fromSystem.currentTimeMillis()
.- Returns:
- A string representation of the time in the format of
yyyy-MM-dd HH:mm:ss
-
fromSeconds
Converts the seconds intoHH: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
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
- Parameters:
millis
-- Returns:
- String
-