[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orekit Users] June 2012 Leap Second



Hello,

I am trying to verify if the upcoming leap second has been added into the
toolkit or not. I am currently using jar 5.0.3 in my project and am not seeing
proper functionality.

I have:

UTCScale utcScale = TimeScalesFactory.getUTC();
String date = "2012-07-01T00:00:00.000";
AbsoluteDate ad = new AbsoluteDate(date, utcScale);
AbsoluteDate base = new AbsoluteDate(2012, 06, 30, 23, 59, 59.0, utcScale);

System.out.println("UTC offset from TAI:" + utcScale.offsetFromTAI(base));
System.out.println("UTC offset from TAI:" + utcScale.offsetFromTAI(ad));
System.out.println("Duration: " + ad.durationFrom(base));

prints:
UTC offset from TAI:-34.0
UTC offset from TAI:-34.0
Duration: 1.0

This code prints a difference of -34.0 seconds. However there will be a Leap
Second added at the end of June 2012 resulting that the proper answer is -35
seconds. and a Duration of 2seconds between these dates.

The dates should function as per this link
ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat

2012 June 30,     23h 59m 59s
2012 June 30,     23h 59m 60s
2012 July  1,        0h  0m  0s

If I have something flawed in my approach please let me know. Or if there will
be a new release prior to the end of the month, I will grab the update then.

Regards,
Matt E.