leapseconds-announced

Leap seconds announced at library release time.

https://github.com/bjornbm/leapseconds-announced

LTS Haskell 23.27:2017.1.0.1
Stackage Nightly 2025-07-13:2017.1.0.1
Latest on Hackage:2017.1.0.1

See all snapshotsleapseconds-announced appears in

BSD-3-Clause licensedbyBjorn Buckwalter
Maintained by[email protected]
This version can be pinned in stack with:leapseconds-announced-2017.1.0.1@sha256:245cdcabb8060cab1bdb19d3a4e253a946db69c1ae636923348c7d3cbd05495b,1431

Module documentation for 2017.1.0.1

Depends on 2 packages(full list with versions):

leapseconds-announced

This libraray provides a staticData.Time.Clock.TAI.LeapSecondTable“containing” the leap seconds announced at library release time.A new version of the library is released every time the InternationalEarth Rotation and Reference Systems Service (IERS) announces a newleap second athttp://hpiers.obspm.fr/eoppc/bul/bulc/bulletinc.dat.

This module is intended to provide a quick-and-dirty leap second solutionfor one-off analyses concerned only with the past and present (i.e. upuntil the next as of yet unannounced leap second), or for applicationswhich can afford to be recompiled against an updated library as oftenas every six months.

Usage

ImportData.Time.Clock.AnnouncedLeapSeconds to bring the leapsecond tablelst into scope. Here is a usage example:

import Data.Timeimport Data.Time.Clock.TAIimport Data.Time.Clock.AnnouncedLeapSeconds-- | Convert from UTC to TAI.utcToTAITime' = utcToTAITime lst-- | Convert from TAI to UTC.taiToUTCTime' = taiToUTCTime lst-- | Add a length of time to a UTC time, respecting leap seconds--   (as opposed to Data.Time.Clock.addUTCTime).addUTCTime' :: DiffTime -> UTCTime -> Maybe UTCTimeaddUTCTime' dt utc = taiToUTCTime' . addAbsoluteTime dt =<< utcToTAITime' utc

Changes

2017.1.0.1 (2017-07)

  • Updated tests for 2017.1 and recent years (thank Dan Burton for filing the issue).

2017.1 (2016-12)

  • Corrected version numbering to reflect API breaking (2017.0.0.1 deprecated).

2017.0.0.1 (2016-12)

  • Ported leapSecondMap of time-1.7.

2017 (2016-06)

  • Added 2017 leap second (2016-12-31T23:59:60Z).

2015.0.0.1 (2015-05)

  • Fix documentation to reflect addition of 2015 leap second.
  • Hide hypothetical leap seconds (prior to 1972-01-01).
  • Add test suite to .cabal.

2015 (2015-01)

  • Added 2015 leap second (2015-06-30T23:59:60Z).

2012 (2012-01)

  • Added 2012 leap second (2012-06-30T23:59:60Z).

2009 (2009-01)

Initial release including all leap seconds up to 2009-01-01.