Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Locale;

public class Main {
    public static String getHourAndMinuteAndSecond(long mils) {
        mils /= 1000;
        int[] time = new int[3];
        time[0] = (int) mils / 3600;
        time[1] = (int) mils / 60 % 60;
        time[2] = (int) mils % 60;
        return String.format(Locale.CHINESE, "%02d:%02d:%02d", time[0], time[1], time[2]);
    }
}