Created
October 28, 2013 23:41
-
-
Save zeroDivisible/7206769 to your computer and use it in GitHub Desktop.
Java & add hours to calendar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Calendar cal = Calendar.getInstance(); // creates calendar | |
cal.setTime(new Date()); // sets calendar time/date | |
cal.add(Calendar.HOUR_OF_DAY, 1); // adds one hour | |
cal.getTime(); // returns new date object, one hour in the future |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment