time-1.6.0.1: A time library

Safe Haskell | Safe
Language | Haskell2010

Data.Time.Clock.TAI

Description

TAI and leap-second tables for converting to UTC: most people won't need this module.

Synopsis

- data AbsoluteTime
- taiEpoch :: AbsoluteTime
- addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime
- diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime
- type LeapSecondTable = Day -> Integer
- utcDayLength :: LeapSecondTable -> Day -> DiffTime
- utcToTAITime :: LeapSecondTable -> UTCTime -> AbsoluteTime
- taiToUTCTime :: LeapSecondTable -> AbsoluteTime -> UTCTime
- parseTAIUTCDATFile :: String -> LeapSecondTable

# Documentation

data AbsoluteTime Source #

AbsoluteTime is TAI, time as measured by a clock.

Instances

Eq AbsoluteTime # |
Methods (==) :: AbsoluteTime -> AbsoluteTime -> Bool # (/=) :: AbsoluteTime -> AbsoluteTime -> Bool #
Data AbsoluteTime # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AbsoluteTime -> c AbsoluteTime Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AbsoluteTime Source # toConstr :: AbsoluteTime -> Constr Source # dataTypeOf :: AbsoluteTime -> DataType Source # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c AbsoluteTime) Source # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AbsoluteTime) Source # gmapT :: (forall b. Data b => b -> b) -> AbsoluteTime -> AbsoluteTime Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AbsoluteTime -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AbsoluteTime -> r Source # gmapQ :: (forall d. Data d => d -> u) -> AbsoluteTime -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> AbsoluteTime -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AbsoluteTime -> m AbsoluteTime Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AbsoluteTime -> m AbsoluteTime Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AbsoluteTime -> m AbsoluteTime Source #
Ord AbsoluteTime # |
Methods compare :: AbsoluteTime -> AbsoluteTime -> Ordering # (<) :: AbsoluteTime -> AbsoluteTime -> Bool # (<=) :: AbsoluteTime -> AbsoluteTime -> Bool # (>) :: AbsoluteTime -> AbsoluteTime -> Bool # (>=) :: AbsoluteTime -> AbsoluteTime -> Bool # max :: AbsoluteTime -> AbsoluteTime -> AbsoluteTime # min :: AbsoluteTime -> AbsoluteTime -> AbsoluteTime #
Show AbsoluteTime # |
Methods showsPrec :: Int -> AbsoluteTime -> ShowS Source # show :: AbsoluteTime -> String Source # showList :: [AbsoluteTime] -> ShowS Source #
NFData AbsoluteTime # |
Methods rnf :: AbsoluteTime -> () Source #

taiEpoch :: AbsoluteTime Source #

The epoch of TAI, which is 1858-11-17 00:00:00 TAI.

addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime Source #

addAbsoluteTime a b = a + b

diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime Source #

diffAbsoluteTime a b = a - b

type LeapSecondTable = Day -> Integer Source #

TAI - UTC during this day. No table is provided, as any program compiled with it would become out of date in six months.

utcDayLength :: LeapSecondTable -> Day -> DiffTime Source #

utcToTAITime :: LeapSecondTable -> UTCTime -> AbsoluteTime Source #

taiToUTCTime :: LeapSecondTable -> AbsoluteTime -> UTCTime Source #

parseTAIUTCDATFile :: String -> LeapSecondTable Source #

Parse the contents of a tai-utc.dat file. This does not do any kind of validation and will return a bad table for input not in the correct format.