update_leap_seconds#

astropy.time.update_leap_seconds(files=None)[source]#

If the current ERFA leap second table is out of date, try to update it.

Leap seconds have been discontinued and the table built into ERFA already includes the last one (2017 January 1), so this is not normally needed, and Time no longer calls it automatically.

Uses astropy.utils.iers.LeapSeconds.auto_open to try to find an up-to-date table. See that routine for the definition of “out of date”.

In order to make it safe to call this any time, all exceptions are turned into warnings,

Parameters:
filespython:list of python:path-like object, optional

List of files/URLs to attempt to open. By default, uses defined by astropy.utils.iers.LeapSeconds.auto_open, which includes the table used by ERFA itself, so if that is up to date, nothing will happen.

Returns:
n_updatepython:int

Number of items updated.