| Safe Haskell | None |
|---|
Data.Thyme.Clock
Contents
Description
Num, Real, Fractional and RealFrac instances for DiffTime and
NominalDiffTime are only available by importing Data.Thyme.Time. In
their stead, instances of AdditiveGroup,
HasBasis and VectorSpace are given here.
Addition and subtraction are performed with the ^+^
and ^-^ operators from
AdditiveGroup, while *^ scales by
a Rational. To find the ratio of two time differences, define:
(^/^) :: (HasBasisv,Basisv ~ (),Scalarv ~ s,Fractionals) => v -> v -> s (^/^) = (/) 'on' flipdecompose'()
Finally, write n where
literals are expected.
*^ basisValue ()
UniversalTime and UTCTime are instances of
AffineSpace, with , and Diff
UniversalTime ≡ DiffTime.
Diff UTCTime ≡
NominalDiffTime
- data UniversalTime
- modJulianDate :: Iso' UniversalTime Rational
- data DiffTime
- microDiffTime :: Iso' Int64 DiffTime
- data UTCTime
- data UTCView = UTCTime {
- utctDay :: !Day
- utctDayTime :: !DiffTime
- utcTime :: Iso' UTCTime UTCView
- data NominalDiffTime
- microNominalDiffTime :: Iso' Int64 NominalDiffTime
- getCurrentTime :: IO UTCTime
- _utctDay :: Lens' UTCTime Day
- _utctDayTime :: Lens' UTCTime DiffTime
Universal Time
data UniversalTime Source
Absolute intervals
Instances
UTC
Constructors
| UTCTime | |
Fields
| |
data NominalDiffTime Source
Instances