Given that we don't know when there will be leap seconds in the future, this conversion is imposible if we want to take leap seconds into account.
So the solution is to either ignore leap seconds (as posix currently does) or have a regular rate of leap seconds (just like leap years). Unfortunately, the rotation of the earth is are not regular enough for a fix rate.
At the scale of a human life, leap seconds are completely irrelevant if you want to know the position of the sun.
So it is bizar that our civil time has leap seconds. Looking back, that seems to be a historical mistake.