This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Get TAI-UTC difference in seconds for a given time using tzdata. | |
i.e., find the number of seconds that must be added to UTC to compute | |
TAI for any timestamp at or after the given time[1]. | |
>>> from datetime import datetime | |
>>> import leapseconds | |
>>> leapseconds.dTAI_UTC_from_utc(datetime(2005, 1, 1)) | |
datetime.timedelta(0, 32) |