Use the list of known and scheduled leap seconds
Python Leap Second List
Leap seconds are corrections applied irregularly so that the UTC day stays fixed to the earth's rotation.
This module provides a class for parsing and validating the standard
leap-seconds.list file. Once parsed, it is possible to retrieve the
full list of leap seconds, or find the TAI-UTC offset for any UTC time.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for leapseconddata-1.0.1-py3-none-any.whl