Package com.targomo.client.api.util
Class TimeUtil
java.lang.Object
com.targomo.client.api.util.TimeUtil
- Author:
- gerb
-
Method Summary
Modifier and TypeMethodDescriptionstatic intGet current date as integerstatic intGet current time as integerstatic StringgetDurationBreakdown(long millis) Convert a millisecond duration to a string formatstatic DategetToday()static Datestatic Datestatic voidstatic intParses time values such as 09:16:45 from gtfs to an integer values represented in seconds.
-
Method Details
-
timeToInt
Parses time values such as 09:16:45 from gtfs to an integer values represented in seconds. For example: 9*3600 + 16*60 + 45- Parameters:
time- the time to parse- Returns:
- number of seconds for given time
-
getCurrentDate
public static int getCurrentDate()Get current date as integer- Returns:
- Current date as integer
-
getCurrentTime
public static int getCurrentTime()Get current time as integer- Returns:
- Current time as integer
-
main
-
getDurationBreakdown
Convert a millisecond duration to a string format- Parameters:
millis- A duration to convert to a string form- Returns:
- A string of the form "X Days Y Hours Z Minutes A Seconds".
-
getToday
- Returns:
- today at noon 12:00:00
-
getTomorrow
- Returns:
- tomorrow at noon 12:00:00
-
getYesterday
- Returns:
- yesterday at noon 12:00:00
-