How do you say, add 1 hour to a given result from calendar.getTime?
ZonedDateTime.now( ZoneId.of( "America/Montreal" ).plusHours( 1 )
The accepted Answer is correct but outdated.
The troublesome old legacy date-time classes have been supplanted by the java.time classes.
ZoneId z = ZoneId.of( "America/Montreal" ); ZonedDateTime zdt = ZonedDateTime.now( z ); ZonedDateTime zdtOneHourLater = zdt.plusHours( 1 );
Note that the wall-clock time may not be an hour later. Anomalies such as Daylight Saving Time (DST) means an hour later may appear to be two hours later jumping from 1 AM to 3 AM for DST switch-over.
The java.time framework is built into Java 8 and later. These classes supplant the troublesome old date-time classes such as
To learn more, see the Oracle Tutorial. And search Stack Overflow for many examples and explanations.
The ThreeTen-Extra project extends java.time with additional classes. This project is a proving ground for possible future additions to java.time. You may find some useful classes here such as
YearQuarter, and more.