How to convert UTC Date Time String to Java object and compare it ?
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);
❤️ Support This Blog
If this post helped you, you can support my writing with a small donation. Thank you for reading.
Comments
Post a Comment