时间

 1 /**
 2  * 
 3  */
 4 
 5 /**
 6  * @Vince YongHeng
 7  *
 8  * 2014年4月11日
 9  */
10 //测出当前时间
11 public class Cd {
12 public static void main(String[]args){
13     long totalMilliseconds=System.currentTimeMillis();
14     
15     long totalSeconds=totalMilliseconds/1000;
16     
17     long currentSecond=totalSeconds%60;
18     
19     long totalMinutes=totalSeconds/60;
20     
21     long currentMinutes=totalMinutes%60;
22     
23     long totalHours=totalMinutes/60;
24     
25     long currentHours=totalHours%24;
26     
27     System.out.println("Current time is :"+currentHours+":"+currentMinutes+":"+currentSecond+" GMT");
28     
29 }
30 
31 }

 

posted @ 2014-04-19 13:02  woaiyuanqi  阅读(113)  评论(0编辑  收藏  举报