Class DateTimeUtils

java.lang.Object
energy.eddie.regionconnector.shared.utils.DateTimeUtils

public class DateTimeUtils extends Object
  • Method Details

    • endOfDay

      public static ZonedDateTime endOfDay(LocalDate localDate, ZoneId zone)
    • oldestDateTime

      public static Optional<ZonedDateTime> oldestDateTime(Collection<ZonedDateTime> dateTimes)
      Finds the oldest date time in a collection of data times. If the collection is empty or only contains null values, returns an empty optional.
      Parameters:
      dateTimes - the collection of date times
      Returns:
      the oldest datetime or empty optional if the collection is empty, or filled with null values.
    • isBeforeOrEquals

      public static boolean isBeforeOrEquals(LocalDate left, LocalDate right)
      Checks if left is before or equal to right. Read as left <= right
      Parameters:
      left - left-hand operand
      right - right-hand operand
      Returns:
      true if left is before or equals to right, otherwise false