merge GroupController into CertificateController

This commit is contained in:
Ehren Kret
2022-07-01 13:04:24 -05:00
parent a25e967978
commit 0fdfdabf2a
6 changed files with 181 additions and 240 deletions

View File

@@ -27,6 +27,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Nonnull;
public class Util {
@@ -166,8 +167,18 @@ public class Util {
return (int) value;
}
public static int currentDaysSinceEpoch(@Nonnull Clock clock) {
return toIntExact(clock.millis() / 1000 / 60/ 60 / 24);
}
/**
* Returns the current number of days since the epoch.
*
* @deprecated use {@link #currentDaysSinceEpoch(Clock)} instead
*/
@Deprecated
public static int currentDaysSinceEpoch() {
return Util.toIntExact(System.currentTimeMillis() / 1000 / 60 / 60 / 24);
return currentDaysSinceEpoch(Clock.systemUTC());
}
public static void sleep(long i) {