Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1.     public static String timeConvert(int time) {
  2.         int min = time / 60;
  3.         int sec = time % 60;
  4.         if(min < 10){
  5.             if(sec < 10)
  6.                 return "0" + min + ":0" + sec;
  7.             return "0" + min + ":" + sec;
  8.         }
  9.         if(sec == 0)
  10.             return "" + min + ":00";
  11.         if(sec < 10)
  12.             return "" + min + ":0" + sec;
  13.         return "" + min + ":" + sec;
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement