Class TimeUtils

java.lang.Object
de.latlon.ets.wfs20.core.utils.TimeUtils

public final class TimeUtils extends Object
Contains utility methods for parsing/reading dates.
Author:
Lyn Goltz
  • Method Details

    • calculateDateRange

      public static Calendar[] calculateDateRange(String[] dateValues)
      Calculates the min and max date values from the given string.
      Parameters:
      dateValues - a list of dates, never null
      Returns:
      the min and max value from the list ([0]= min , [1]=max). If the values list contains only one entry, min and max are equal. An empty array if the values list is empty.
    • calculateValueBetween

      public static String calculateValueBetween(Calendar[] range)
      Calculates a date value in the range.
      Parameters:
      range - must contain exactly two values ([0]= min , [1]=max), min and may may be equal, never null
      Returns:
      a value in the range, if min == max this value is returned, never null
    • calculateValueBetween

      public static String calculateValueBetween(long minTimeInMillis, long maxTimeInMillis)
      Calculates a date value in the range.
      Parameters:
      minTimeInMillis - min datetime, never null
      maxTimeInMillis - max dateTime, never null
      Returns:
      a value in the range, never null