Odd runtime exception due to leap second… ;-)

I just discovered a highly unusual issue that really made me laugh…

We have an application that generates event logfiles which contain, among other items, a processing time in ms. These logfiles are parsed by a different application.

On 2009-01-01 at 00:59:59 local time (UTC+1) this application generated an exception because it couldn’t properly parse the logfile. There was a negative processing time which should never occur. WTF?!

Considering the strange date and time and then thinking about it some fractions of a second (;-)) I immediately found the reason for this strange issue:

Exactly at that time a so-called “leap second” was inserted, so that 00:59:59 occurred “twice.” And since the second occurence was just between the first and second measure point, we had a negative duration of 912 ms (instead of 88 ms.) 🙂

Now, is that a strange problem??? Can you beat that?! 😉

Leave a Reply

Your email address will not be published. Required fields are marked *