I'm trying to calculate a simple time diffrence.
It's a simple math calculation, but i don't know how to do it.
What im trying to do is for example to calculate 23:23:20 - 23:23:10 = 00:00:10.
And I want to save the result.
My question is: how do I write the code?
I tried this, not sure how right it is
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC+2:00")); Date currentLocalTime = cal.getTime();
DateFormat date = new SimpleDateFormat("HH:mm a");
date.setTimeZone(TimeZone.getTimeZone("UTC+2:00"));
String localTime = date.format(currentLocalTime);