org.keycloak.util.Time Maven / Gradle / Ivy
package org.keycloak.util;
import java.util.Date;
/**
* @author Stian Thorgersen
*/
public class Time {
private static int offset;
public static int currentTime() {
return ((int) (System.currentTimeMillis() / 1000)) + offset;
}
public static Date toDate(int time) {
return new Date(((long) time ) * 1000);
}
public static long toMillis(int time) {
return ((long) time) * 1000;
}
public static void setOffset(int offset) {
Time.offset = offset;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy