com.moengage.CustomDateTime Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of condition-evaluator Show documentation
Show all versions of condition-evaluator Show documentation
Condition Evaluator for MoEngage Platform
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;
}
}