3

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?

Meno Hochschild
  • 42,708
  • 7
  • 104
  • 126

1 Answers1

1

You need to update your timezone data in JRE:

Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141
  • I tried the above option but still I am getting the same issue! Java time in milliseconds is same as Unix time in milliseconds. But the new Date() in java is showing 25 seconds more! When i change the time zone to UTC, everything works fine. (I checked UTC there is no leap second present) – user2376487 Mar 31 '15 at 06:15
  • and which timezone do you experience issue with? – Sergey Grinev Mar 31 '15 at 10:08
  • I am facing issue with GMT timezone. – user2376487 Apr 01 '15 at 04:47
  • Oracle does not deploy the leap second infos contained in TZDB so the suggested procedure is completely useless even if Oracle blindly copies the TZDB-news into its own announcements of TZ-Updater-versions. See also this [SO-post](http://stackoverflow.com/q/28918934/2491410). – Meno Hochschild Jun 19 '15 at 10:14