Here you can find the source of formatTime(int seconds)
public static String formatTime(int seconds)
//package com.java2s; /*//from ww w.j a v a 2s . c om * Copyright Siemens AG, 2014-2016. * With modifications by Bosch Software Innovations GmbH, 2016 * Part of the SW360 Portal Project. * * SPDX-License-Identifier: EPL-1.0 * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ public class Main { public static String formatTime(int seconds) { if (seconds < 0) { return "not set"; } int hours = seconds / 3600; int remainder = seconds % 3600; int minutes = remainder / 60; seconds = remainder % 60; return String.format("%02d:%02d:%02d", hours, minutes, seconds); } }