Here you can find the source of secondsToMinutes(int seconds)
Parameter | Description |
---|---|
seconds | The number of seconds to convert |
public static String secondsToMinutes(int seconds)
//package com.java2s; /**/*from ww w.j ava 2 s . com*/ * Distributed as part of Fwap'a Derp UHC. A UHC plugin for Spigot 1.9 * made by Ashrynn Macke (Flutterflies). You should have received a copy * of the MIT license with this code, if not please find it here: * https://opensource.org/licenses/MIT */ public class Main { /** * Converts seconds into minutes * * @param seconds The number of seconds to convert * @return A string formatted 'MM:SS' */ public static String secondsToMinutes(int seconds) { //Get the number of minutes int ms = seconds / 60; //Get the number of seconds int ss = seconds % 60; String m = (ms < 10 ? "0" : "") + ms; String s = (ss < 10 ? "0" : "") + ss; return m + ":" + s; } }