Java tutorial
//package com.java2s; public class Main { public static String sec2mi(String sec) { String mi = null; if (sec == null) { mi = "00 : 00"; } else if (Double.parseDouble(sec) > 60) { mi = (int) Double.parseDouble(sec) / 60 + " : " + (int) Double.parseDouble(sec) % 60; } else { mi = "00 : " + (int) Double.parseDouble(sec); } return mi; } }