# leapseconds

## 语法

``T = leapseconds``
``[T,vers] = leapseconds``

## 说明

``T = leapseconds` 返回一个时间表，其中包含 `datetime` 数据类型支持的闰秒的列表。对于每个闰秒，时间表包括它发生的日期、其符号以及截至该日期为止的累积闰秒数。要将日期和时间的闰秒计算在内，请使用 `datetime` 函数创建 `datetime` 数组，然后将 `'TimeZone'` 名称-值对组参量的值指定为 `'UTCLeapSeconds'`。`

``[T,vers] = leapseconds` 返回 MATLAB® 中使用的闰秒数据的国际地球自转和参考系统服务 (IERS) 公告 C 版本号。IERS 根据需要定期声明新闰秒。有关详细信息，请参阅 IERS Bulletins。`

## 示例

`T = leapseconds`
```T=27×2 timetable Date Type CumulativeAdjustment ___________ ____ ____________________ 30-Jun-1972 + 1 sec 31-Dec-1972 + 2 sec 31-Dec-1973 + 3 sec 31-Dec-1974 + 4 sec 31-Dec-1975 + 5 sec 31-Dec-1976 + 6 sec 31-Dec-1977 + 7 sec 31-Dec-1978 + 8 sec 31-Dec-1979 + 9 sec 30-Jun-1981 + 10 sec 30-Jun-1982 + 11 sec 30-Jun-1983 + 12 sec 30-Jun-1985 + 13 sec 31-Dec-1987 + 14 sec 31-Dec-1989 + 15 sec 31-Dec-1990 + 16 sec ⋮ ```

`T = leapseconds`
```T=27×2 timetable Date Type CumulativeAdjustment ___________ ____ ____________________ 30-Jun-1972 + 1 sec 31-Dec-1972 + 2 sec 31-Dec-1973 + 3 sec 31-Dec-1974 + 4 sec 31-Dec-1975 + 5 sec 31-Dec-1976 + 6 sec 31-Dec-1977 + 7 sec 31-Dec-1978 + 8 sec 31-Dec-1979 + 9 sec 30-Jun-1981 + 10 sec 30-Jun-1982 + 11 sec 30-Jun-1983 + 12 sec 30-Jun-1985 + 13 sec 31-Dec-1987 + 14 sec 31-Dec-1989 + 15 sec 31-Dec-1990 + 16 sec ⋮ ```

`tr = timerange('2008','year')`
```tr = timetable timerange subscript: Select timetable rows with times in the half-open interval: Starting at, including: 01-Jan-2008 00:00:00 Ending at, but excluding: 01-Jan-2009 00:00:00 ```

`T(tr,:)`
```ans=1×2 timetable Date Type CumulativeAdjustment ___________ ____ ____________________ 31-Dec-2008 + 24 sec ```

```[T,vers] = leapseconds; vers```
```vers = 66 ```

## 输出参量

IERS 公告 C 版本号，以整数形式返回。