I have an initial time 12:00:00
and I need to add 144
mins to it.
The expected output is 15.24.00
(i.e, adding 2.24 hours to the initial time).
How should I update the current code given below ?
String startTime = "13:00:00";
SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss");
Date date1 = null;
Date date2 = null;
try {
date1 = format.parse(startTime);
} catch (ParseException e) {
e.printStackTrace();
}
Long addition = (long) (TimeUnit.MILLISECONDS.toMinutes(date1.getTime()));
System.out.println("Difference : "+addition);