fork download
  1. import java.text.ParseException;
  2. import java.text.SimpleDateFormat;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5.  
  6. class Test{
  7. public static void main(String[] args) throws ParseException{
  8. Calendar cal = Calendar.getInstance();
  9. Date date=new SimpleDateFormat("yyyy/MM/dd").parse("2013/08/22");
  10. cal.setTime(date);
  11. System.out.println(cal.getTime());
  12. cal.add(Calendar.DATE,1);
  13. System.out.println(cal.getTime());
  14. }
  15. }
Success #stdin #stdout 0.11s 380992KB
stdin
Standard input is empty
stdout
Thu Aug 22 00:00:00 GMT 2013
Fri Aug 23 00:00:00 GMT 2013