The leapseconds-announced package

[Tags: bsd3, library]

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


[Skip to ReadMe]

Properties

Versions2009, 2012, 2015, 2015.0.0.1
Change logchangelog.md
Dependenciesbase (<10), time (<2) [details]
LicenseBSD3
CopyrightBjorn Buckwalter 2009-2015
AuthorBjorn Buckwalter
Maintainerbjorn@buckwalter.se
StabilityStable
CategorySystem
Home pagehttps://github.com/bjornbm/leapseconds-announced
Bug trackerhttps://github.com/bjornbm/leapseconds-announced/issues
Source repositoryhead: git clone https://github.com/bjornbm/leapseconds-announced
UploadedMon May 18 12:39:26 UTC 2015 by BjornBuckwalter
DistributionsNixOS:2015.0.0.1
Downloads437 total (24 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Last success reported on 2015-05-20 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for leapseconds-announced-2015.0.0.1

leapseconds-announced

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 http://hpiers.obspm.fr/eoppc/bul/bulc/bulletinc.dat.

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.

Usage

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'