Skip to content

JuliaTime/LeapSeconds.jl

Repository files navigation

LeapSeconds

Leap seconds in Julia

Stable Docs Dev Docs Build Status Windows Build Status codecov.io

A new minor version of this package will be published everytime a new leap second is issued be the IERS and dependent packages will need to be updated!

Installation

pkg> add LeapSeconds

Usage

The package exports the two functions offset_tai_utc and offset_utc_tai which return the difference between International Atomic Time (TAI) and Coordinated Universal Time (UTC) or vice versa for a given date. For dates after 1972-01-01, this is the number of leap seconds.

using LeapSeconds
using Dates

tai = DateTime(2017, 1, 1) # 2017-01-01T00:00:00.0 TAI

# Pass a `DateTime` instance...
offset_tai_utc(tai)

# ...or a Julian day number.
offset_tai_utc(datetime2julian(tai))

# Or use UTC...
utc = DateTime(2017, 1, 1) # 2017-01-01T00:00:00.0 UTC

# ...as a `DateTime`...
offset_utc_tai(utc)

# ...or a pseudo-Julian day number.
offset_utc_tai(datetime2julian(utc))

Documentation

Please refer to the documentation for additional information.