Use java.time.Instant;
import java.time.Instant;
Instant instantStart = Instant.parse("20200229T12:00:00Z");
Instant instantEnd = Instant.parse("20200329T12:00:00Z");
Instant instantNow = Instant.now();
return instantNow.isAfter(instantStart) &&
instantNow.isBefore(instantEnd);
No comments:
Post a Comment