Package com.atlassian.jira.search
Class DateIndexHelpers
java.lang.Object
com.atlassian.jira.search.DateIndexHelpers
Contains some common date methods used when working with the indexes.
- Since:
- 10.5
-
Method Summary
Modifier and TypeMethodDescriptionstatic Date
plusSeconds
(Date date, long secondsToAdd) Add (or subtract) a number of seconds from a date.static Date
Strips the milliseconds from a date.static long
stripMillisecondsFromTimestamp
(long timestamp) Strips the milliseconds from a timestamp.
-
Method Details
-
plusSeconds
Add (or subtract) a number of seconds from a date.- Parameters:
date
- The date we're starting fromsecondsToAdd
- The number of seconds we'll add (can be negative)- Returns:
- The resulting date after adding/subtracting the seconds
- Since:
- 10.6
-
stripMillisecondsFromDate
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.
-