简体   繁体   English

Java时间超过linux时间(闰秒)

[英]Java time ahead of linux time (leap second)

I have changed the Linux system date to Sat Jun 30 23:50:00 2012. After changing the date I am running a simple java program to log the system date. 我已将Linux系统日期更改为2012年6月30日星期六23:50:00。更改日期后,我正在运行一个简单的java程序来记录系统日期。 The problem is: Java is logging 25 seconds ahead of Linux system time. 问题是:Java在Linux系统时间之前提前25秒进行记录。 For example: Java log: 2012-07-01 00:02:15 INFO Scheduler:19 - Sun Jul 01 00:02:15 GMT 2012 Linux time: Sun Jul 1 00:01:50 GMT 2012 Both are GMT! 例如:Java日志:2012-07-01 00:02:15 INFO调度程序:19 - Sun Jul 01 00:02:15 GMT 2012 Linux时间:Sun Jul 1 00:01:50 GMT 2012两者都是GMT!

I am doing this to analyze the leap second issue. 我这样做是为了分析闰秒问题。 I checked total no of leap second in /etc/localtime it is 25. zdump -v /etc/localtime | 我检查了/ etc / localtime中的闰秒总数是25。zdump -v / etc / localtime | grep 59:60 | grep 59:60 | wc -l 25 wc -l 25

I rebooted the system and also restarted the ntp server but still there is 25 second difference! 我重新启动了系统并重新启动了ntp服务器,但仍有25秒的差异!

I am using SUSE Linux Enterprise Server 11 SP3 (x86_64) and JAVA 1.7 我使用的是SUSE Linux Enterprise Server 11 SP3(x86_64)和JAVA 1.7

Please help me out to understand what is wrong? 请帮帮我了解有什么问题? And how to fix this? 以及如何解决这个问题?

You need to update your timezone data in JRE: 您需要在JRE中更新您的时区数据:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM