Package com.palmergames.util
Class TimeTools
java.lang.Object
com.palmergames.util.TimeTools
- Author:
- dumptruckman
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
convertToShortTicks
(double timeSeconds) Converts Seconds to 'Short' Ticks These ticks are only relevant to the 'Short' Timer Task Rounds half upstatic long
convertToTicks
(long t) Converts Seconds to Ticksstatic int
getDays
(long milliSeconds) static int
getHours
(long milliSeconds) static long
static long
getSeconds
(String dhms) static long
static long
getTimeInMillisXDaysAgo
(int days) static long
getTimeInMillisXHoursAgo
(int hours) static long
getTimeInMillisXMinutesAgo
(int minutes) static long
getTimeInMillisXSecondsAgo
(int seconds) static long
secondsFromDhms
(String dhms) This will parse a time string such as 2d30m to an equivalent amount of seconds.
-
Constructor Details
-
TimeTools
public TimeTools()
-
-
Method Details
-
secondsFromDhms
This will parse a time string such as 2d30m to an equivalent amount of seconds.- Parameters:
dhms
- The time string- Returns:
- The amount of seconds
-
getMillis
-
getSeconds
-
getTicks
-
convertToTicks
public static long convertToTicks(long t) Converts Seconds to Ticks- Parameters:
t
- - Unix time- Returns:
- ticks
-
convertToShortTicks
public static int convertToShortTicks(double timeSeconds) Converts Seconds to 'Short' Ticks These ticks are only relevant to the 'Short' Timer Task Rounds half up- Parameters:
timeSeconds
- number of seconds to convert.- Returns:
- ticks
-
getHours
public static int getHours(long milliSeconds) -
getDays
public static int getDays(long milliSeconds) -
getTimeInMillisXSecondsAgo
public static long getTimeInMillisXSecondsAgo(int seconds) -
getTimeInMillisXMinutesAgo
public static long getTimeInMillisXMinutesAgo(int minutes) -
getTimeInMillisXHoursAgo
public static long getTimeInMillisXHoursAgo(int hours) -
getTimeInMillisXDaysAgo
public static long getTimeInMillisXDaysAgo(int days)
-