Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.*;

public class Main {

    public static String getNumberTime(long time_second) {

        long seconds = time_second % 60;

        long minutes = (time_second / 60) % 60;

        long hours = time_second / 3600;

        Formatter formatter = new Formatter(null, Locale.getDefault());

        return formatter.format("%02d:%02d:%02d", hours, minutes, seconds).toString();

    }
}