Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
  2. Calendar cal = Calendar.getInstance();
  3. String currenttime = new String(dateFormat.format(cal.getTime()));
  4. String futuretime = new String (dateFormat.format(__________); //how to store future date if i have the current date
  5. System.out.println(dateFormat.format(cal.getTime()));
  6.  
  7. Calendar cal2 = Calendar.getInstance();
  8. cal2.add(Calendar.DAY_OF_MONTH, 3);//A date in future (achieved somehow)
  9. String currenttime = new String(dateFormat.format(cal.getTime()));
  10. String futuretime = new String (dateFormat.format(cal2.getTime()));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement