Here you can find the source of getFormattedDuration(int simTimeSeconds)
public static String getFormattedDuration(int simTimeSeconds)
//package com.java2s; /*// ww w .j a v a2s. c o m * #%L * Common * %% * Copyright (C) 2011 - 2015 Intuit Inc. * %% * 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 * #L% */ import java.text.NumberFormat; public class Main { private static final int TIME_60 = 60; private static final int TIME_3600 = 3600; private static NumberFormat nf; /** * @return the simulation time in the following format hh:mm:ss */ public static String getFormattedDuration(int simTimeSeconds) { int hours = simTimeSeconds / TIME_3600; simTimeSeconds = simTimeSeconds - (hours * TIME_3600); int minutes = simTimeSeconds / TIME_60; simTimeSeconds = simTimeSeconds - (minutes * TIME_60); int seconds = simTimeSeconds; return nf.format(hours) + ":" + nf.format(minutes) + ":" + nf.format(seconds); } }