dev.sixpack.utils.Deterministic Maven / Gradle / Ivy
package dev.sixpack.utils;
import io.temporal.workflow.Workflow;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
public abstract class Deterministic {
public static Instant deterministicNow() {
return Instant.ofEpochMilli(Workflow.currentTimeMillis());
}
public static ZonedDateTime deterministicZonedNow(ZoneId zoneId) {
return ZonedDateTime.ofInstant(deterministicNow(), zoneId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy