org.defendev.common.time.ClockManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-jdk Show documentation
Show all versions of common-jdk Show documentation
Common utils purely based on JDK and no other dependencies. Only exception being for org.jetbrains:annotations for building stratgic Kotlin language compatibility.Another only-exception is Apache Commons Lang3.
The newest version!
package org.defendev.common.time;
import java.time.Clock;
public class ClockManager implements IClockManager {
private Clock baseClock;
public ClockManager(Clock baseClock) {
this.baseClock = baseClock;
}
@Override
public Clock clockUtc() {
return baseClock.withZone(TimeUtil.ZULU_ZONE_ID);
}
@Override
public Clock clockEuropeWarsaw() {
return baseClock.withZone(TimeUtil.EUROPE_WARSAW_ZONE_ID);
}
}