com.moengage.util.DateTimeUtil Maven / Gradle / Ivy
package com.moengage.util;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.util.TimeZone;
public class DateTimeUtil {
private final LocalDateTime dateTimeInstance;
public DateTimeUtil() {
this.dateTimeInstance = LocalDateTime.now();
}
public LocalDateTime getInstance() {
return this.dateTimeInstance;
}
public ZonedDateTime getTimeWithTimeZone(TimeZone timeZone) {
return this.getInstance().atZone(timeZone.toZoneId());
}
}