import java.time.Instant;
import java.time.temporal.ChronoUnit;
public class Main {
/**
* Returns true if the specified instant
* is after the current instant.
*/
public static boolean isFutureInstant(Instant instant) {
return instant.isAfter(Instant.now());
}
public static void main(String[] args) {
// Example: 30 minutes in the future
Instant futureInstant =
Instant.now().plus(30, ChronoUnit.MINUTES);
if (isFutureInstant(futureInstant)) {
System.out.println("The timestamp is in the future.");
} else {
System.out.println("The timestamp is not in the future.");
}
}
}
/*
run:
The timestamp is in the future.
*/