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

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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy