Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Calendar;
- import java.util.Date;
- /**
- * Created with IntelliJ IDEA.
- * User: aubels
- * Date: 12/12/12
- * Time: 9:54 AM
- * To change this template use File | Settings | File Templates.
- */
- public class d12 {
- public static void main(String[] args)
- {
- Calendar calendar = Calendar.getInstance();
- calendar.set(2012,Calendar.DECEMBER,12,0,0,0);
- System.out.println(calendar.getTime().toString());
- calendar.add(Calendar.DATE, 1);
- calendar.add(Calendar.MONTH, 1);
- calendar.add(Calendar.YEAR, 1);
- System.out.println(calendar.getTime().toString());
- }
- }
- Returns:
- Wed Dec 12 00:00:00 EST 2012
- Mon Jan 13 00:00:00 EST 2014
- See 13/13/13 does exist.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement