Unix time does not count elapsed seconds in real time since 1970-01-01T00:00:00, this is a common misconception.

Unix time assumes a fixed number of seconds per day. 86400. If a leap second is inserted, either end of June or end of December, the day is 86401 seconds long.

There are different implementations for how your Unix time will behave 24 hours before to 24 hours after the leap second. A timestamp might just repeat during the leap second or the system changes the length of a second in a time range around the leap second introduction to make up the difference. This is called smearing.

A simple example is the elapsed time between these two timestamps:

    2016-12-31 23:59:50
    2017-01-01 00:00:10
Unix time differs by 20 seconds (assuming the system/library doesn't use smearing). But actually elapsed time is 21 seconds, since

    2016-12-31 23:59:60
was the last added leap second. This timestamp cannot be represented by Unix time (again assuming no smearing, with smearing you could).