All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.sixpack.utils.Deterministic Maven / Gradle / Ivy

The newest version!
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