Java Millisecond Convert millisToLongM(long duration)

Here you can find the source of millisToLongM(long duration)

Description

millis To Long M

License

Apache License

Declaration

public static String millisToLongM(long duration) 

Method Source Code

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

public class Main {
    public final static long ONE_SECOND = 1000;
    public final static long ONE_MINUTE = ONE_SECOND * 60;

    public static String millisToLongM(long duration) {
        StringBuffer res = new StringBuffer();
        long temp = 0;
        if (duration >= ONE_SECOND) {

            temp = duration / ONE_MINUTE;
            duration -= temp * ONE_MINUTE;
            res.append(temp).append(" minute").append(temp > 1 ? "s" : "");

            return res.toString();
        } else {//from   w w w  .  ja v a2  s.  com
            return "0 second";
        }
    }
}

Related

  1. millisToHMS(long millis)
  2. millisToHMSShort(long millis)
  3. millisToLongDHMS(long duration)
  4. millisToLongDHMS(long duration)
  5. millisToLongDHMS(long duration, String pubDate)
  6. millisToNanos(final long millis)
  7. millisToNanos(int i)
  8. millisToNanos(long millis)
  9. millisToNanos(long millis)