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 parseTime(int ms) {
        StringBuilder builder = new StringBuilder();
        int hour = ms / 1000 / 3600;
        if (hour < 10) {
            builder.append("0");
        }
        builder.append(hour);
        builder.append(":");
        int minute = ms / 1000 % 3600 / 60;
        if (minute < 10) {
            builder.append("0");
        }
        builder.append(minute);
        builder.append(":");
        int second = ms / 1000 % 3600 % 60;
        if (second < 10) {
            builder.append("0");
        }
        builder.append(second);
        return builder.toString();
    }
}