https://en.wikipedia.org/wiki/Leap_second
It seems like there's not much agreement on what to do about -- or whether to even use -- leap seconds.
Sounds like a fairly complex problem to solve, given such a relatively miniscule amount of time -- possibly even tougher than solving leap year and/or time zones/DST.