Class DateTimeUtility

java.lang.Object
org.serviceconnector.util.DateTimeUtility

public final class DateTimeUtility extends Object
The Class DateTimeUtility. Provides basic date time operations.
  • Method Details

    • getCurrentTimeZoneMillis

      public static String getCurrentTimeZoneMillis()
      Gets the current time zone millis.
      Returns:
      the current time zone millis
    • getCurrentTime

      public static Date getCurrentTime()
      Gets the current time.
      Returns:
      the current time
    • getCurrentDate

      public static Date getCurrentDate()
      Gets the current date
      Returns:
      the current date
    • getCurrentTimeMillis

      public static long getCurrentTimeMillis()
      Gets the current time (ms).
      Returns:
      the current time (ms)
    • getDateTimeAsString

      public static String getDateTimeAsString(Date date)
      Gets the date time as string.
      Parameters:
      date - the date
      Returns:
      the date and time as string
    • getIncrementTimeMillis

      public static Date getIncrementTimeMillis(Date date, long inc)
      Gets the increment time in millis.
      Parameters:
      date - the date
      inc - the inc
      Returns:
      the increment time in millis
    • parseDateString

      public static Date parseDateString(String dateString) throws ParseException
      Parses the date string.
      Parameters:
      dateString - the date string
      Returns:
      the date
      Throws:
      ParseException - the parse exception
    • parseDateStringUTC

      public static Date parseDateStringUTC(String dateString) throws ParseException
      Parses the date string to UTC.
      Parameters:
      dateString - the date string
      Returns:
      the date
      Throws:
      ParseException - the parse exception
    • isSameDay

      public static boolean isSameDay(Date date)
      Checks if is same day.
      Parameters:
      date - the date
      Returns:
      true, if is same day