Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String GetTime(long whs) {
        String time = "";
        long h = whs / 3600000;
        long m = (whs / 60000) % 60;
        long s = (whs / 1000) % 60;
        time += String.valueOf(h);
        if (String.valueOf(m).length() < 2)
            time += ":0" + String.valueOf(m);
        else
            time += ":" + String.valueOf(m);

        if (String.valueOf(s).length() < 2)
            time += ":0" + String.valueOf(s);
        else
            time += ":" + String.valueOf(s);
        return time;
    }
}