Class DateUtil

java.lang.Object
com.atlassian.plugin.servlet.util.date.DateUtil

public final class DateUtil extends Object
Class responsible for handling processes related to dates.
Since:
4.1.18
  • Method Details

    • localDateTimeOf

      public static Optional<LocalDateTime> localDateTimeOf(@Nullable Date date)
      Converts a certain Date to LocalDate and filter negative dates.
      Parameters:
      date - The date to be converted.
      Returns:
      The object containing the converted date.
    • defaultIfNull

      public static LocalDateTime defaultIfNull(@Nullable Date date, @Nonnull LocalDateTime defaultValue)
      Converts a certain Date to LocalDate.
      Parameters:
      date - The date to be converted.
      defaultValue - The default value if the date is null.
      Returns:
      The object containing the converted date.