Class TimeUtil

java.lang.Object
com.targomo.client.api.util.TimeUtil

public final class TimeUtil extends Object
Author:
gerb
  • Method Details

    • timeToInt

      public static int timeToInt(String time)
      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

      public static void main(String[] args)
    • getDurationBreakdown

      public static String getDurationBreakdown(long millis)
      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

      public static Date getToday()
      Returns:
      today at noon 12:00:00
    • getTomorrow

      public static Date getTomorrow()
      Returns:
      tomorrow at noon 12:00:00
    • getYesterday

      public static Date getYesterday()
      Returns:
      yesterday at noon 12:00:00