The leapseconds-announced package

[Tags:bsd3, library, test]

Provides an easy to use static Data.Time.Clock.TAI.LeapSecondTable with the leap seconds announced at library release time.

[Skip to Readme]


Versions 2009, 2012, 2015, 2015.0.0.1, 2017
Change log
Dependencies base (<10), time (<2) [details]
License BSD3
Copyright Bjorn Buckwalter 2009-2016
Author Bjorn Buckwalter
Stability Stable
Category System
Home page
Bug tracker
Source repository head: git clone
Uploaded Wed Jul 13 05:56:53 UTC 2016 by BjornBuckwalter
Distributions LTSHaskell:2017, NixOS:2017, Stackage:2017, Tumbleweed:2017
Downloads 671 total (14 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2016-07-13 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for leapseconds-announced

Readme for leapseconds-announced-2017


This libraray provides a static Data.Time.Clock.TAI.LeapSecondTable "containing" the leap seconds announced at library release time. A new version of the library is released every time the International Earth Rotation and Reference Systems Service (IERS) announces a new leap second at

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


Import Data.Time.Clock.AnnouncedLeapSeconds to bring the leap second table lst into scope. Here is a usage example:

import Data.Time
import Data.Time.Clock.TAI
import 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 -> UTCTime
addUTCTime' dt = taiToUTCTime' . addAbsoluteTime dt . utcToTAITime'