Package de.presti.ree6.utils.others
Class TimeUtil
java.lang.Object
de.presti.ree6.utils.others.TimeUtil
Utility class for the Time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Period
getDifferenceBetween
(LocalDateTime start, LocalDateTime end) Get the difference between the two given LocalDateTime.static String
getFormattedDate
(Period period) Get a formatted String of a Time-period.static String
getTime
(long t) Get a formatted String of the difference between the given time and the current Time.static int
getTimeinMin
(int s) Get a specific time amount that is presented as seconds as minutes.static int
getTimeinSec
(long time) Get a specific time amount that is presented as milliseconds as seconds.
-
Method Details
-
getDifferenceBetween
Get the difference between the two given LocalDateTime.- Parameters:
start
- The start LocalDateTime.end
- The end LocalDateTime.- Returns:
- The difference between the two given LocalDateTime.
-
getFormattedDate
Get a formatted String of a Time-period.- Parameters:
period
- The Time-period.- Returns:
- A formatted String of a Time-period.
-
getTimeinSec
public static int getTimeinSec(long time) Get a specific time amount that is presented as milliseconds as seconds.- Parameters:
time
- The time amount.- Returns:
- The time amount as seconds.
-
getTimeinMin
public static int getTimeinMin(int s) Get a specific time amount that is presented as seconds as minutes.- Parameters:
s
- The time amount.- Returns:
- The time amount as minutes.
-
getTime
Get a formatted String of the difference between the given time and the current Time.- Parameters:
t
- The time.- Returns:
- A formatted String of the difference between the given time and the current Time.
-