fork download
  1. import java.time.ZoneId;
  2. import java.time.ZonedDateTime;
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. ZonedDateTime now = ZonedDateTime.now(ZoneId.of("America/New_York"));
  7. ZonedDateTime afterOneMin = now.plusMinutes(1);
  8. ZonedDateTime afterFiveMin = now.plusMinutes(5);
  9.  
  10. System.out.println(now);
  11. System.out.println(afterOneMin);
  12. System.out.println(afterFiveMin);
  13. }
  14. }
Success #stdin #stdout 0.13s 51676KB
stdin
Standard input is empty
stdout
2021-10-25T08:34:51.589950-04:00[America/New_York]
2021-10-25T08:35:51.589950-04:00[America/New_York]
2021-10-25T08:39:51.589950-04:00[America/New_York]