leapseconds-announced: Leap seconds announced at library release time.

[ bsd3, library, system ] [ Propose Tags ]

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


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 2009, 2012, 2015, 2015.0.0.1, 2017, 2017.0.0.1, 2017.1, 2017.1.0.1 (info)
Change log changelog.md
Dependencies base (<10), time (>=1.7 && <2) [details]
License BSD-3-Clause
Copyright Bjorn Buckwalter 2009-2016
Author Bjorn Buckwalter
Maintainer bjorn@buckwalter.se
Category System
Home page https://github.com/bjornbm/leapseconds-announced
Bug tracker https://github.com/bjornbm/leapseconds-announced/issues
Source repo head: git clone https://github.com/bjornbm/leapseconds-announced
Uploaded by BjornBuckwalter at 2017-07-30T19:40:53Z
Distributions LTSHaskell:2017.1.0.1, NixOS:2017.1.0.1, Stackage:2017.1.0.1
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 5872 total (29 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-07-30 [all 1 reports]

Readme for leapseconds-announced-2017.1.0.1

[back to package description]

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 -> Maybe UTCTime
addUTCTime' dt utc = taiToUTCTime' . addAbsoluteTime dt =<< utcToTAITime' utc