public class Time {
public static void current(long l){
long hour=0;
long minute=0;
long second=0;
l%=24*60*60; //only time XX:XX:XX
hour=l/3600;
l%=3600;
minute=l/60;
second=l%60;
System.out.println( hour + ":" + minute + ":" + second );
}
public static void main(String[] args) {
// TODO Auto-generated method stub
long time = System.currentTimeMillis();
current(time);
}
}
------解决方案--------------------
System.currentTimeMillis() 返回的距离epoch的毫秒数。不是你想象的