code: private static String convertSecondsToString(int totalSeconds) {
          if (totalSeconds < 0) {
              return null;
          }
          int hours = totalSeconds / 3600;
          int remainder = totalSeconds - (hours * 3600);
          int minutes = remainder / 60;
          int seconds = remainder - (minutes * 60);
          if (hours > 0) {
              return String.format("%2d:%02d:%02d", hours, minutes, seconds);
          } else {
              return String.format("%02d:%02d", minutes, seconds);
          }
      }
docs: Creates a formatted time string from a total seconds value, formatted as
  "h:mm:ss".
  
  For example, supplying the value 3930.0f seconds will return @"1:05:30".
  
  @param totalSeconds
  The number of seconds from which to create the time string.
  @return the formatted time as "h:mm:ss"