public class testmillis {
public static void main(String[] args) {
long currentTimeMillis = System.currentTimeMillis();
//总秒数
long totalSeconds = currentTimeMillis / 1000;
long Seconds = totalSeconds%60;
//总分钟
long totalMinutes = totalSeconds / 60;
//当前分钟数
long Minutes = totalMinutes % 60;
//总小时数
long totalHours = totalMinutes / 60;
//当前小时数
long hours = totalHours % 24;
System.out.println("当前的时间是:"+(hours+8)+":"+Minutes+":"+Seconds+"\t");//因为区域不同不是用北京时间来算的.
}
}
10-06
1218
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-27