For example Long day=24 * 60 * 60 * 1000;//a day how many milliseconds Long hour=60 * 60 * 1000;//an hour how many milliseconds Long min=60 * 1000;//a minute how many milliseconds Long the SEC=1000; A second//how many milliseconds Long t=System. CurrentTimeMillis ();//the current milliseconds System. Out. Printf (" 02 02 02 % d: % d: % d \ n ", (t % day/hour, hour (t %)/min, min) (t %/SEC).//the number of milliseconds to day modulo divided by the number of milliseconds an hour's time, for more than the number of milliseconds to take an hour is divided by the number of milliseconds one minute minute, for a minute more than the number of milliseconds to take a second divided by the number of milliseconds is seconds