@@ -286,7 +286,9 @@ public class ZillaRuntime { | |||||
public static String uuid() { return UUID.randomUUID().toString(); } | public static String uuid() { return UUID.randomUUID().toString(); } | ||||
@Getter @Setter private static AtomicLong systemTimeOffset = new AtomicLong(0L); | |||||
private static AtomicLong systemTimeOffset = new AtomicLong(0L); | |||||
public static long getSystemTimeOffset () { return systemTimeOffset.get(); } | |||||
public static void setSystemTimeOffset (long t) { systemTimeOffset.set(t); } | |||||
public static long incrementSystemTimeOffset(long t) { return systemTimeOffset.addAndGet(t); } | public static long incrementSystemTimeOffset(long t) { return systemTimeOffset.addAndGet(t); } | ||||
public static long now() { return System.currentTimeMillis() + systemTimeOffset.get(); } | public static long now() { return System.currentTimeMillis() + systemTimeOffset.get(); } | ||||
public static String hexnow() { return toHexString(now()); } | public static String hexnow() { return toHexString(now()); } | ||||
@@ -7,6 +7,8 @@ import org.cobbzilla.util.daemon.ZillaRuntime; | |||||
import org.joda.time.DateTime; | import org.joda.time.DateTime; | ||||
import org.joda.time.DateTimeZone; | import org.joda.time.DateTimeZone; | ||||
import static org.cobbzilla.util.daemon.ZillaRuntime.getSystemTimeOffset; | |||||
@NoArgsConstructor | @NoArgsConstructor | ||||
public class CurrentTime { | public class CurrentTime { | ||||
@@ -17,7 +19,7 @@ public class CurrentTime { | |||||
public CurrentTime(DateTimeZone tz) { | public CurrentTime(DateTimeZone tz) { | ||||
zone = tz.getID(); | zone = tz.getID(); | ||||
now = new CurrentTimeValues(tz, ZillaRuntime.now()); | now = new CurrentTimeValues(tz, ZillaRuntime.now()); | ||||
realNow = ZillaRuntime.getSystemTimeOffset().get() == 0 ? null : new CurrentTimeValues(tz, ZillaRuntime.realNow()); | |||||
realNow = getSystemTimeOffset() == 0 ? null : new CurrentTimeValues(tz, ZillaRuntime.realNow()); | |||||
} | } | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||