I am tying to get last quarter of current time in android.
for example the time is 12:45:00
and I need to have:
12:30:00
12:45:00
or the time is 10:50:00
and I need to have :
10:35:00
10:50:00
etc.
I write this code and I get result true :
DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
Calendar cal = Calendar.getInstance();
cal.setTime(cal.getTime());
cal.add(Calendar.MINUTE, -15);
String oneQuarterBack = dateFormat.format(cal.getTime());
But If I had 12:45:38
how I can calculate seconds ?