Modifier and Type | Method and Description |
---|---|
static Date |
fromSecondsSinceEpoch(long time)
Converts the specified Unix epoch time in seconds to a date object.
|
static boolean |
isAfter(Date date,
Date reference,
long maxClockSkewSeconds)
Check if the specified date is after the specified reference, given
the maximum accepted clock skew.
|
static boolean |
isBefore(Date date,
Date reference,
long maxClockSkewSeconds)
Checks if the specified data is before the specified reference,
given the maximum accepted clock skew.
|
static long |
toSecondsSinceEpoch(Date date)
Converts the specified date object to a Unix epoch time in seconds.
|
public static long toSecondsSinceEpoch(Date date)
date
- The date. Must not be null
.public static Date fromSecondsSinceEpoch(long time)
time
- The Unix epoch time, in seconds. Must not be negative.public static boolean isAfter(Date date, Date reference, long maxClockSkewSeconds)
Formula:
return date +/- clock_skew > reference
date
- The date to check. Must not be
null
.reference
- The reference date. Must not be
null
.maxClockSkewSeconds
- The maximum acceptable clock skew of the
date value to check, in seconds.true
if the date is before the reference, plus or
minus the maximum accepted clock skew, else false
.public static boolean isBefore(Date date, Date reference, long maxClockSkewSeconds)
Formula:
return date +/- clock_skew < reference
date
- The date to check. Must not be
null
.reference
- The reference date. Must not be
null
.maxClockSkewSeconds
- The maximum acceptable clock skew of the
date value to check, in seconds.true
if the date is before the reference, plus or
minus the maximum accepted clock skew, else false
.Copyright © 2015 Connect2id Ltd.. All Rights Reserved.