battle programming a forum for elite programmers with extreme will power to sharpen theire skills
 
HomeSearchRegisterLog in
Share
 

 java get future time

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 395
Join date : 2011-08-02

java get future time Empty
PostSubject: java get future time   java get future time EmptyFri May 03, 2019 5:25 pm

Code:
Calendar cal = Calendar.getInstance();
      System.out.println("current date: " + cal.getTime());
      cal.add(Calendar.MINUTE, 7);
      SimpleDateFormat df = new SimpleDateFormat("HH:mm");
      System.out.println("7 minutes later: " + df.format(cal.getTime()));

cal.add(Calendar.MINUTE, 7);
.what to add to (can be days seconds...)
,7 : how many to add it is on

_________________
MB over and out emp it up
Back to top Go down
 
java get future time
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: battle programming-
Jump to: