fork download
  1. import java.time.ZoneId;
  2. import java.time.ZonedDateTime;
  3.  
  4. class Main {
  5. public static void main(String[] args) {
  6. ZoneId zone = ZoneId.of("America/New_York");
  7. ZonedDateTime now = ZonedDateTime.now(zone);
  8. ZonedDateTime after182Days = now.plusDays(182);
  9. System.out.println(zone + " now=" + now.getOffset() + " / +182=" + after182Days.getOffset());
  10. }
  11. }
Success #stdin #stdout 0.22s 54744KB
stdin
Standard input is empty
stdout
America/New_York now=-05:00 / +182=-04:00