Here you can find the source of formatTime(long time)
Parameter | Description |
---|---|
time | in milliseconds that should be converted |
public static String formatTime(long time)
//package com.java2s; //License from project: Open Source License public class Main { /**/*www. ja v a 2s. c o m*/ * * @param time in milliseconds that should be converted * @return a String, e.g like this: 24 Tag(e), 15 Stunde(n), 13 Minute(n), 1 * Sekunde(n) */ public static String formatTime(long time) { long second = (time / 1000) % 60; long minute = (time / (1000 * 60)) % 60; long hour = (time / (1000 * 60 * 60)) % 24; long day = (time / (1000 * 60 * 60 * 24)); return String.format("%d Tag(e), %02d Stunde(n), %02d Minute(n) und %02d Sekunde(n)", day, hour, minute, second); } }