Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java calendar add minutes

 String myTime = "14:10";
 SimpleDateFormat df = new SimpleDateFormat("HH:mm");
 Date d = df.parse(myTime); 
 Calendar cal = Calendar.getInstance();
 cal.setTime(d);
 cal.add(Calendar.MINUTE, 10);
 String newTime = df.format(cal.getTime());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #calendar #add #minutes
ADD COMMENT
Topic
Name
8+6 =