time-compat-1.9.8: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.Clock.TAI.Compat

Contents

- TAI arithmetic
- leap-second map type
- conversion between UTC and TAI with map

Synopsis

- data AbsoluteTime
- taiEpoch :: AbsoluteTime
- addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime
- diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime
- taiNominalDayStart :: Day -> AbsoluteTime
- type LeapSecondMap = Day -> Maybe Int
- utcDayLength :: LeapSecondMap -> Day -> Maybe DiffTime
- utcToTAITime :: LeapSecondMap -> UTCTime -> Maybe AbsoluteTime
- taiToUTCTime :: LeapSecondMap -> AbsoluteTime -> Maybe UTCTime
- taiClock :: Maybe (DiffTime, IO AbsoluteTime)

# TAI arithmetic

data AbsoluteTime Source #

AbsoluteTime is TAI, time as measured by a clock.

#### Instances

Instances details

NFData AbsoluteTime |
Instance details Defined in Data.Time.Clock.Internal.AbsoluteTime Methods rnf :: AbsoluteTime -> () Source #
Data AbsoluteTime |

Instance details

Defined in Data.Time.Clock.Internal.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 :: forall r r'. (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 #

Show AbsoluteTime |
Instance details Defined in Data.Time.Clock.TAI Methods showsPrec :: Int -> AbsoluteTime -> ShowS Source # show :: AbsoluteTime -> String Source # showList :: [AbsoluteTime] -> ShowS Source #
Eq AbsoluteTime |
Instance details Defined in Data.Time.Clock.Internal.AbsoluteTime Methods (==) :: AbsoluteTime -> AbsoluteTime -> Bool Source # (/=) :: AbsoluteTime -> AbsoluteTime -> Bool Source #
Ord AbsoluteTime |

Instance details

Defined in Data.Time.Clock.Internal.AbsoluteTime

Methods

compare :: AbsoluteTime -> AbsoluteTime -> Ordering Source #

(<) :: AbsoluteTime -> AbsoluteTime -> Bool Source #

(<=) :: AbsoluteTime -> AbsoluteTime -> Bool Source #

(>) :: AbsoluteTime -> AbsoluteTime -> Bool Source #

(>=) :: AbsoluteTime -> AbsoluteTime -> Bool Source #

max :: AbsoluteTime -> AbsoluteTime -> AbsoluteTime Source #

min :: AbsoluteTime -> AbsoluteTime -> 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

taiNominalDayStart :: Day -> AbsoluteTime Source #

# leap-second map type

type LeapSecondMap = Day -> Maybe Int Source #

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

# conversion between UTC and TAI with map

utcDayLength :: LeapSecondMap -> Day -> Maybe DiffTime Source #

utcToTAITime :: LeapSecondMap -> UTCTime -> Maybe AbsoluteTime Source #

taiToUTCTime :: LeapSecondMap -> AbsoluteTime -> Maybe UTCTime Source #

taiClock :: Maybe (DiffTime, IO AbsoluteTime) Source #

TAI clock, if it exists. Note that it is unlikely to be set correctly, without due care and attention.