To get the time I apply:
public String hhmmss(){ Locale locale = new Locale("ru", "RU"); SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss ", locale); String timevaluetime = timeFormat.format(new GregorianCalendar().getTimeInMillis()); return timevaluetime; At the moment1 I get the time String timevaluetime1 = hhmmss(); At time2 I get the time String timevaluetime2 = hhmmss() ; How to determine the difference in time (time period) elapsed between moment 1 and moment 2.