Class DateIndexHelpers

java.lang.Object
com.atlassian.jira.search.DateIndexHelpers

public final class DateIndexHelpers extends Object
Contains some common date methods used when working with the indexes.
Since:
10.5
  • Method Details

    • plusSeconds

      public static Date plusSeconds(Date date, long secondsToAdd)
      Add (or subtract) a number of seconds from a date.
      Parameters:
      date - The date we're starting from
      secondsToAdd - The number of seconds we'll add (can be negative)
      Returns:
      The resulting date after adding/subtracting the seconds
      Since:
      10.6
    • stripMillisecondsFromDate

      public static Date stripMillisecondsFromDate(Date date)
      Strips the milliseconds from a date. Supports dates before the epoch. For example 1963-03-12T13:27:16.877 will become 1963-03-12T13:27:16.
      Since:
      10.6
    • stripMillisecondsFromTimestamp

      public static long stripMillisecondsFromTimestamp(long timestamp)
      Strips the milliseconds from a timestamp.