Java Time Print printTime(long millis)

Here you can find the source of printTime(long millis)

Description

print Time

License

Open Source License

Declaration

public static String printTime(long millis) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String printTime(long millis) {
        long second = (millis / 1000) % 60;
        long minute = (millis / (1000 * 60)) % 60;
        long hour = (millis / (1000 * 60 * 60)) % 24;

        String time = String.format("%02d:%02d:%02d:%d", hour, minute, second, millis);

        return time;
    }//from   ww  w.j ava  2  s.  co  m
}

Related

  1. printTime(long starttime, long endtime)
  2. printTime(long time, String spacer)
  3. printTime(String msg)
  4. printTimer(String blah)