简体   繁体   中英

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. The problem is: Java is logging 25 seconds ahead of Linux system time. 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!

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 | grep 59:60 | wc -l 25

I rebooted the system and also restarted the ntp server but still there is 25 second difference!

I am using SUSE Linux Enterprise Server 11 SP3 (x86_64) and 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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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