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);
}
}
计算GMT时间
最新推荐文章于 2021-11-25 21:45:47 发布