Java TimeUnit Usage formatMillisIntoMinutesAndSeconds(long millis)

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

Description

format Millis Into Minutes And Seconds

License

Open Source License

Declaration

public static String formatMillisIntoMinutesAndSeconds(long millis) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.TimeUnit;

public class Main {
    public static String formatMillisIntoMinutesAndSeconds(long millis) {
        return String.format("%d min, %d sec", TimeUnit.MILLISECONDS.toMinutes(millis),
                TimeUnit.MILLISECONDS.toSeconds(millis)
                        - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)));
    }//from  w w  w  .ja v a  2  s  .c o m
}

Related

  1. formatMillis(final long millis)
  2. formatMillis(final long millis)
  3. formatMillis(long millis)
  4. formatMillis(long millis)
  5. formatMillisecs(long lMillisecs, final boolean bWantMSecs)
  6. formatMs(long millis)
  7. formatSeconds(int seconds)
  8. formatTime(long time)
  9. formatTime(long time)