TimeUntil.java 396 B

1234567891011121314151617
  1. package antiafk.timeUntil;
  2. import java.time.Duration;
  3. import java.time.Instant;
  4. public class TimeUntil {
  5. public long calcBetween(Instant event) {
  6. if (event == null) return 0;
  7. Instant now = Instant.now();
  8. Duration diff = Duration.between(event, now);
  9. return diff.toMillis();
  10. }
  11. public Instant getNowInInstant() {
  12. return Instant.now();
  13. }
  14. }