Advertisement
damesova

ConvertTimeOutput [Method]

May 16th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.22 KB | None | 0 0
  1. public static String convertTime(long totalS) {
  2.  
  3.         long s = totalS % 60;
  4.         long m = (totalS / 60) % 60;
  5.         long h = (totalS / (60 * 60)) % 24;
  6.  
  7.         return String.format("%02d:%02d:%02d", h, m, s);
  8.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement