Java Time Format formatTime(int secs)

Here you can find the source of formatTime(int secs)

Description

format Time

License

Open Source License

Declaration

public static String formatTime(int secs) 

Method Source Code

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

public class Main {
    public static String formatTime(int secs) {
        String minutes = String.valueOf(secs / 60);
        String seconds = String.valueOf(secs % 60);
        if (secs % 60 < 10) {
            seconds = "0" + seconds;
        }/*ww w  .j a va 2  s.  co  m*/
        if (secs % 60 == 0) {
            seconds = "00";
        }
        return minutes + ":" + seconds;
    }
}

Related

  1. formatTime(int minutes)
  2. formatTime(int originalTime)
  3. formatTime(int seconds)
  4. formatTime(int seconds)
  5. formatTime(int seconds)
  6. formatTime(int time)
  7. formatTime(int time)
  8. formatTime(int time)
  9. formatTime(int time)