public class BambooDateUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
dateToPortableString(Date date) |
static String |
dateToPortableString(Date date,
TimeZone timeZone) |
static Date |
fromIsoTimestampString(String dateString) |
static Duration |
getDurationToNow(Date dateToCompare) |
static long |
getMillisDistanceToNow(Date dateToCompare) |
static long |
getMinutesDistanceToNow(Date dateToCompare) |
static long |
getSecondsDistanceToNow(Date dateToCompare) |
static boolean |
isWithinDays(Date earlierDate,
Date laterDate,
long days)
Returns whether the laterDate is not later than the number of "days" since the last earlierDate
|
static boolean |
isWithinMillis(Date date1,
Date date2,
long millis)
Returns true if the two given dates are within the given number of millis.
|
static Date |
makeReasonableDate(Date date)
Caps dates predating The Epoch to Epoch.
|
static Date |
portableDateStringToDate(String dateString) |
static String |
toIsoTimestampString(Date date) |
public static boolean isWithinDays(Date earlierDate, Date laterDate, long days)
earlierDate
- - must not be nulllaterDate
- - must not be nulldays
- - must be a positive integerpublic static boolean isWithinMillis(@Nullable Date date1, @Nullable Date date2, long millis)
date1
- - must not be nulldate2
- - must not be nullmillis
- - must be a positive longpublic static String dateToPortableString(@NotNull Date date, @NotNull TimeZone timeZone)
public static Date portableDateStringToDate(@NotNull String dateString) throws ParseException
ParseException
public static long getMinutesDistanceToNow(@NotNull Date dateToCompare)
public static long getSecondsDistanceToNow(@NotNull Date dateToCompare)
public static long getMillisDistanceToNow(@NotNull Date dateToCompare)
@NotNull public static Date fromIsoTimestampString(@NotNull String dateString)
Copyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.