Java Millisecond Convert millisToWords(long millis)

Here you can find the source of millisToWords(long millis)

Description

millis To Words

License

Apache License

Declaration

public static String millisToWords(long millis) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String millisToWords(long millis) {
        double dhrs = (millis / (double) (3600000));
        double dmin = (dhrs - Math.floor(dhrs)) * 60;
        double dsec = (dmin - Math.floor(dmin)) * 60;
        int hrs = (int) dhrs;
        int min = (int) dmin;
        int sec = (int) dsec;
        return (hrs > 0 ? (hrs + (" hour" + (hrs > 1 ? "s " : " "))) : "") + (min > 0 ? min + " minutes " : "")
                + (sec + " seconds");
    }// w w w .j a va  2s . c o  m
}

Related

  1. millisToTime(float millis)
  2. millisToTime(long ms)
  3. millisToTimeSpan(final long interv)
  4. millisToTimeSpan(long millis)
  5. MillisToTimeString(long millis)
  6. toMillis(int seconds)
  7. toMillis(int timeInSecs)
  8. toMillis(long nanos)
  9. toMilliSeconds(float t)