I have a date variable (endTime) with some value (eg : 10:40). I need to create a new variable by adding 10 minutes to endTime. How can I do it?
Thanks in advance
public static String endTime = "";
DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
Calendar cal = Calendar.getInstance();
endTime = timeFormat.format(cal.getTime());`
You can use
add
method on yourCalendar
:Found in Javadoc, it takes me 30 seconds.