Android examples for java.util:Time
get String Representation For time Duration
//package com.java2s; public class Main { private static final int HOURS_TO_SECONDS = 3600; private static final int MINUTES_TO_SECONDS = 60; public static String getStringRepresentationFor(int duration) { int h = duration / HOURS_TO_SECONDS; int m = (duration - (h * HOURS_TO_SECONDS)) / MINUTES_TO_SECONDS; int s = (duration - (h * HOURS_TO_SECONDS)) % MINUTES_TO_SECONDS; return String.format("%02d:%02d:%02d hh:mm:ss", h, m, s); }//from w w w .ja v a 2s. c om }