Officially, it depends on the OS and implementation - at least for Date . From java.util.Date docs:
Although the Date class is designed to display Coordinated Universal Time (UTC), it may not do this exactly, depending on the host environment of the Java virtual machine. Almost all modern operating systems assume that in all cases 1 day = 24 × 60 × 60 = 86400 seconds. In UTC, however, about once a year or two there is an extra second called a “leap second”. The second jump is always added as the last second of the day and is always December 31 or June 30. For example, the last minute of 1995 was 61 seconds, thanks to the added second of the jump. Most computer watches are not accurate enough to reflect the difference in jumps.
I suspect that you will find that although your computer clock is approximately the same as UTC, it is done through NTP or the like, periodically correcting the clock, and not the operating system that actually implements leap seconds.
I believe JRE libraries usually take an 86400 second day. It makes life a lot easier, and if you are still going to fix inaccurate system clocks, you can also edit the jump seconds correctly.
You really want to figure out what interests you. If you need a way to represent dates and times that use leap seconds, the standard Java libraries may not work very well for you. Even the JSR-310 no longer supports second jumps, as far as I can tell (this is a very reasonable solution for most developers).
Jon skeet
source share