Safe Haskell | None |
---|
Num
, Real
, Fractional
and RealFrac
instances for DiffTime
and
NominalDiffTime
are only available by importing Data.Thyme.Time. In
their stead are instances of AdditiveGroup
,
HasBasis
and VectorSpace
, with
.
Scalar
DiffTime
≡ Scalar
NominalDiffTime
≡ Rational
Using fromSeconds
and toSeconds
to convert between TimeDiff
s and
other numeric types. If you really must coerce between DiffTime
and
NominalDiffTime
,
.
view
(microseconds
. from
microseconds
)
UTCTime
is an instance of AffineSpace
, with
.
Diff
UTCTime
≡ NominalDiffTime
UTCTime
is not Y294K-compliant. Please file a bug report on GitHub when
this becomes a problem.
- data UniversalTime
- modJulianDate :: Iso' UniversalTime Rational
- data DiffTime
- data UTCTime
- data UTCView = UTCTime {
- utctDay :: !Day
- utctDayTime :: !DiffTime
- utcTime :: Iso' UTCTime UTCView
- data NominalDiffTime
- getCurrentTime :: IO UTCTime
- class (HasBasis t, Basis t ~ (), Scalar t ~ Rational) => TimeDiff t where
- microseconds :: Iso' t Int64
- toSeconds :: (TimeDiff t, Fractional n) => t -> n
- fromSeconds :: (Real n, TimeDiff t) => n -> t
- toSeconds' :: TimeDiff t => t -> Rational
- fromSeconds' :: TimeDiff t => Rational -> t
- _utctDay :: Lens' UTCTime Day
- _utctDayTime :: Lens' UTCTime DiffTime
Universal Time
data UniversalTime Source
Absolute intervals
UTC
UTCTime | |
|
data NominalDiffTime Source
Time interval conversion
class (HasBasis t, Basis t ~ (), Scalar t ~ Rational) => TimeDiff t whereSource
Time differences, encompassing both DiffTime
and NominalDiffTime
.
FIXME: still affected by http://hackage.haskell.org/trac/ghc/ticket/7611?
microseconds :: Iso' t Int64Source
Escape hatch; avoid.
toSeconds :: (TimeDiff t, Fractional n) => t -> nSource
Convert a time difference to some Fractional
type.
fromSeconds :: (Real n, TimeDiff t) => n -> tSource
toSeconds' :: TimeDiff t => t -> RationalSource
Type-restricted toSeconds
to avoid constraint-defaulting warnings.
fromSeconds' :: TimeDiff t => Rational -> tSource
Type-restricted fromSeconds
to avoid constraint-defaulting warnings.