计算GMT时间

来源:互联网 发布:mac 双系统 打游戏卡 编辑:程序博客网 时间:2024/05/17 01:11
public class ShowCurrentTime {public static void main(String[] args){long totalMillseconds=System.currentTimeMillis();long totalSeconds=totalMillseconds/1000;long currentSeconds=totalSeconds%60;long totalMinutes=totalSeconds/60;long currentMinutes=totalMinutes%60;long totalHours=totalMinutes/60;long currentHours=totalHours%24;System.out.println("GMT is "+currentHours+":"+currentMinutes+":"+currentSeconds);}}

原创粉丝点击