time-compat-1.9.3: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.Clock.Compat

Contents

- Universal Time
- Absolute intervals, DiffTime
- UTCTime
- NominalDiffTime
- UTC differences
- Current time

Synopsis

- newtype UniversalTime = ModJulianDate {
  - getModJulianDate :: Rational
  }
- data DiffTime
- secondsToDiffTime :: Integer -> DiffTime
- picosecondsToDiffTime :: Integer -> DiffTime
- diffTimeToPicoseconds :: DiffTime -> Integer
- data UTCTime = UTCTime {
  - utctDay :: Day
  - utctDayTime :: DiffTime
  }
- data NominalDiffTime
- secondsToNominalDiffTime :: Pico -> NominalDiffTime
- nominalDiffTimeToSeconds :: NominalDiffTime -> Pico
- nominalDay :: NominalDiffTime
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- getCurrentTime :: IO UTCTime
- getTime_resolution :: DiffTime

# Universal Time

Time as measured by the Earth.

newtype UniversalTime #

Constructors

ModJulianDate |

Fields

- getModJulianDate :: Rational

#### Instances

Instances details

Eq UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods (==) :: UniversalTime -> UniversalTime -> Bool (/=) :: UniversalTime -> UniversalTime -> Bool
Data UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniversalTime -> c UniversalTime

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UniversalTime

toConstr :: UniversalTime -> Constr

dataTypeOf :: UniversalTime -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UniversalTime)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UniversalTime)

gmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r

gmapQ :: (forall d. Data d => d -> u) -> UniversalTime -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniversalTime -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime

Ord UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

compare :: UniversalTime -> UniversalTime -> Ordering

(<) :: UniversalTime -> UniversalTime -> Bool

(<=) :: UniversalTime -> UniversalTime -> Bool

(>) :: UniversalTime -> UniversalTime -> Bool

(>=) :: UniversalTime -> UniversalTime -> Bool

max :: UniversalTime -> UniversalTime -> UniversalTime

min :: UniversalTime -> UniversalTime -> UniversalTime

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

# Absolute intervals, DiffTime

data DiffTime #

#### Instances

Instances details

Enum DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods succ :: DiffTime -> DiffTime pred :: DiffTime -> DiffTime toEnum :: Int -> DiffTime fromEnum :: DiffTime -> Int enumFrom :: DiffTime -> [DiffTime] enumFromThen :: DiffTime -> DiffTime -> [DiffTime] enumFromTo :: DiffTime -> DiffTime -> [DiffTime] enumFromThenTo :: DiffTime -> DiffTime -> DiffTime -> [DiffTime]
Eq DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (==) :: DiffTime -> DiffTime -> Bool (/=) :: DiffTime -> DiffTime -> Bool
Fractional DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (/) :: DiffTime -> DiffTime -> DiffTime recip :: DiffTime -> DiffTime fromRational :: Rational -> DiffTime
Data DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime

toConstr :: DiffTime -> Constr

dataTypeOf :: DiffTime -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime)

gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r

gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime

Num DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (+) :: DiffTime -> DiffTime -> DiffTime (-) :: DiffTime -> DiffTime -> DiffTime (*) :: DiffTime -> DiffTime -> DiffTime negate :: DiffTime -> DiffTime abs :: DiffTime -> DiffTime signum :: DiffTime -> DiffTime fromInteger :: Integer -> DiffTime
Ord DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods compare :: DiffTime -> DiffTime -> Ordering (<) :: DiffTime -> DiffTime -> Bool (<=) :: DiffTime -> DiffTime -> Bool (>) :: DiffTime -> DiffTime -> Bool (>=) :: DiffTime -> DiffTime -> Bool max :: DiffTime -> DiffTime -> DiffTime min :: DiffTime -> DiffTime -> DiffTime
Real DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods toRational :: DiffTime -> Rational
RealFrac DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods properFraction :: Integral b => DiffTime -> (b, DiffTime) truncate :: Integral b => DiffTime -> b round :: Integral b => DiffTime -> b ceiling :: Integral b => DiffTime -> b floor :: Integral b => DiffTime -> b
Show DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods showsPrec :: Int -> DiffTime -> ShowS show :: DiffTime -> String showList :: [DiffTime] -> ShowS
NFData DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods rnf :: DiffTime -> ()

secondsToDiffTime :: Integer -> DiffTime #

picosecondsToDiffTime :: Integer -> DiffTime #

diffTimeToPicoseconds :: DiffTime -> Integer #

# UTCTime

data UTCTime #

Constructors

UTCTime |

Fields

- utctDay :: Day
- utctDayTime :: DiffTime

#### Instances

Instances details

Eq UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods (==) :: UTCTime -> UTCTime -> Bool (/=) :: UTCTime -> UTCTime -> Bool
Data UTCTime |

Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCTime -> c UTCTime

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime

toConstr :: UTCTime -> Constr

dataTypeOf :: UTCTime -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime)

gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r

gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime

Ord UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods compare :: UTCTime -> UTCTime -> Ordering (<) :: UTCTime -> UTCTime -> Bool (<=) :: UTCTime -> UTCTime -> Bool (>) :: UTCTime -> UTCTime -> Bool (>=) :: UTCTime -> UTCTime -> Bool max :: UTCTime -> UTCTime -> UTCTime min :: UTCTime -> UTCTime -> UTCTime
NFData UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods rnf :: UTCTime -> ()
ISO8601 UTCTime |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format UTCTime #

# NominalDiffTime

data NominalDiffTime #

#### Instances

Instances details

Enum NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

succ :: NominalDiffTime -> NominalDiffTime

pred :: NominalDiffTime -> NominalDiffTime

toEnum :: Int -> NominalDiffTime

fromEnum :: NominalDiffTime -> Int

enumFrom :: NominalDiffTime -> [NominalDiffTime]

enumFromThen :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime]

enumFromTo :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime]

enumFromThenTo :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime -> [NominalDiffTime]

Eq NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (==) :: NominalDiffTime -> NominalDiffTime -> Bool (/=) :: NominalDiffTime -> NominalDiffTime -> Bool
Fractional NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (/) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime recip :: NominalDiffTime -> NominalDiffTime fromRational :: Rational -> NominalDiffTime
Data NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime

toConstr :: NominalDiffTime -> Constr

dataTypeOf :: NominalDiffTime -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime)

gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r

gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime

Num NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

(+) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime

(-) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime

(*) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime

negate :: NominalDiffTime -> NominalDiffTime

abs :: NominalDiffTime -> NominalDiffTime

signum :: NominalDiffTime -> NominalDiffTime

fromInteger :: Integer -> NominalDiffTime

Ord NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

compare :: NominalDiffTime -> NominalDiffTime -> Ordering

(<) :: NominalDiffTime -> NominalDiffTime -> Bool

(<=) :: NominalDiffTime -> NominalDiffTime -> Bool

(>) :: NominalDiffTime -> NominalDiffTime -> Bool

(>=) :: NominalDiffTime -> NominalDiffTime -> Bool

max :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime

min :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime

Real NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods toRational :: NominalDiffTime -> Rational
RealFrac NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods properFraction :: Integral b => NominalDiffTime -> (b, NominalDiffTime) truncate :: Integral b => NominalDiffTime -> b round :: Integral b => NominalDiffTime -> b ceiling :: Integral b => NominalDiffTime -> b floor :: Integral b => NominalDiffTime -> b
Show NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods showsPrec :: Int -> NominalDiffTime -> ShowS show :: NominalDiffTime -> String showList :: [NominalDiffTime] -> ShowS
NFData NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods rnf :: NominalDiffTime -> ()

secondsToNominalDiffTime :: Pico -> NominalDiffTime #

nominalDiffTimeToSeconds :: NominalDiffTime -> Pico #

nominalDay :: NominalDiffTime #

# UTC differences

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime #

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime #

# Current time

getCurrentTime :: IO UTCTime #

getTime_resolution :: DiffTime #