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

com.moengage.CustomDateTime Maven / Gradle / Ivy

There is a newer version: 1.3.7
Show newest version
package com.moengage;

import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.util.TimeZone;

public class CustomDateTime {
    LocalDateTime instance;
    CustomDateTime(){
        this.instance = LocalDateTime.now();
    }
    CustomDateTime(int year, int month, int dayOfMonth, int hour, int minute, int second){
        this.instance = LocalDateTime.of(year, month, dayOfMonth, hour, minute, second);
    }

    public ZonedDateTime getTimeWithTimeZone(TimeZone timeZone){
        return this.instance.atZone(timeZone.toZoneId());
    }

    public LocalDateTime getInstance() {
        return instance;
    }

    public void setInstance(LocalDateTime instance) {
        this.instance = instance;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy