Class DateUtils
-
- All Implemented Interfaces:
public final class DateUtils
-
-
Method Summary
Modifier and Type Method Description final static Booleanafter(Date $self, Date that)Tests if this date is after that date. final static Datemax(Date dateA, Date dateB)Returns the greater of two dates. final static Datemin(Date dateA, Date dateB)Returns the minimum of two dates. final static DatemaxOf(Date dates)Returns the maximum of the given dates. final static DateminOf(Date dates)Returns the minimum of the given dates. final static TimeDurationdiff(Date $self, Long otherTime)Returns difference between this date and the otherTime in TimeDuration. final static TimeDurationdiff(Date $self, Date that)Returns difference between this date and that date in TimeDuration. final static BooleanisWithinDurationFromNow(Date $self, TimeDuration duration, Function0<Long> now)Returns true if the date is within the specified duration from now. final static DatetruncateFuture(Date $self, Function0<Long> now)Truncates the date to the current time if it's in the future. -
-
Method Detail
-
diff
final static TimeDuration diff(Date $self, Long otherTime)
Returns difference between this date and the otherTime in TimeDuration.
-
diff
final static TimeDuration diff(Date $self, Date that)
Returns difference between this date and that date in TimeDuration.
-
isWithinDurationFromNow
final static Boolean isWithinDurationFromNow(Date $self, TimeDuration duration, Function0<Long> now)
Returns true if the date is within the specified duration from now.
-
truncateFuture
final static Date truncateFuture(Date $self, Function0<Long> now)
Truncates the date to the current time if it's in the future.
-
-
-
-