thyme-0.3.5.5: A faster time library

Safe HaskellNone
LanguageHaskell2010

Data.Thyme.Clock

Contents

Description

Types and functions for UTC and UT1.

If you don't care about leap seconds, keep to UTCView and NominalDiffTime for your clock calculations, and you'll be fine.

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 DiffTimeScalar NominalDiffTimeRational.

Using fromSeconds and toSeconds to convert between TimeDiffs and other numeric types. If you really must coerce between DiffTime and NominalDiffTime, view (microseconds . from microseconds).

UTCView is an instance of AffineSpace, with Diff UTCViewNominalDiffTime.

UTCView is not Y294K-compliant. Please file a bug report on GitHub when this becomes a problem.

Synopsis

Universal Time

data UniversalTime #

The principal form of universal time, namely UT1.

UniversalTime is defined by the rotation of the Earth around its axis relative to the Sun. Thus the length of a day by this definition varies from one to the next, and is never exactly 86400 SI seconds unlike TAI or AbsoluteTime. The difference between UT1 and UTC is DUT1.

Instances
Bounded UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Enum UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Eq UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Data UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

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 :: (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.Thyme.Clock.Internal

Ix UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Generic UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Rep UniversalTime :: Type -> Type #

Arbitrary UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

CoArbitrary UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

coarbitrary :: UniversalTime -> Gen b -> Gen b #

NFData UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

rnf :: UniversalTime -> () #

Random UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Unbox UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

ParseTime UniversalTime # 
Instance details

Defined in Data.Thyme.Format

FormatTime UniversalTime # 
Instance details

Defined in Data.Thyme.Format

Methods

showsTime :: TimeLocale -> UniversalTime -> (Char -> ShowS) -> Char -> ShowS #

Vector Vector UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

MVector MVector UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Thyme UniversalTime UniversalTime # 
Instance details

Defined in Data.Thyme.Time.Core

type Rep UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Rep UniversalTime = D1 (MetaData "UniversalTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-5fDUuKjOKkrCqjpykDCZJz" True) (C1 (MetaCons "UniversalRep" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NominalDiffTime)))
newtype Vector UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

newtype MVector s UniversalTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

modJulianDate :: Iso' UniversalTime Rational #

View UniversalTime as a fractional number of days since the Modified Julian Date epoch.

Absolute intervals

data DiffTime #

An absolute time interval as measured by a clock.

DiffTime forms an AdditiveGroup―so can be added using ^+^ (or ^-^ for subtraction), and also an instance of VectorSpace―so can be scaled using *^, where

type Scalar DiffTime = Rational
Instances
Bounded DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Enum DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Eq DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Fractional DiffTime # 
Instance details

Defined in Data.Thyme.Time

Data DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

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 :: (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.Thyme.Time

Ord DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Read DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Real DiffTime # 
Instance details

Defined in Data.Thyme.Time

RealFrac DiffTime # 
Instance details

Defined in Data.Thyme.Time

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.Thyme.Clock.Internal

Ix DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Generic DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Rep DiffTime :: Type -> Type #

Methods

from :: DiffTime -> Rep DiffTime x #

to :: Rep DiffTime x -> DiffTime #

Arbitrary DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

CoArbitrary DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

coarbitrary :: DiffTime -> Gen b -> Gen b #

NFData DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

rnf :: DiffTime -> () #

Random DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Unbox DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

HasBasis DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Basis DiffTime :: Type #

VectorSpace DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Scalar DiffTime :: Type #

AdditiveGroup DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

TimeDiff DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

microseconds :: Iso' DiffTime Int64 #

Vector Vector DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

MVector MVector DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Thyme DiffTime DiffTime # 
Instance details

Defined in Data.Thyme.Time.Core

Methods

thyme :: Iso' DiffTime0 DiffTime #

type Rep DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Rep DiffTime = D1 (MetaData "DiffTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-5fDUuKjOKkrCqjpykDCZJz" True) (C1 (MetaCons "DiffTime" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Micro)))
newtype Vector DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Basis DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Basis DiffTime = ()
type Scalar DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

newtype MVector s DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

UTC

data UTCTime #

Coördinated universal time: the most common form of universal time for civil timekeeping. It is synchronised with AbsoluteTime and both tick in increments of SI seconds, but UTC includes occasional leap-seconds so that it does not drift too far from UniversalTime.

UTCView is an instance of AffineSpace, with

type Diff UTCView = NominalDiffTime

Use .+^ to add (or .-^ to subtract) time intervals of type NominalDiffTime, and .-. to get the interval between UTCViews.

Performance
Internally this is a 64-bit count of microseconds since the MJD epoch, so .+^, .-^ and .-. ought to be fairly fast.
Issues
UTCView currently cannot represent leap seconds.
Instances
Bounded UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Enum UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Eq UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

(==) :: UTCTime -> UTCTime -> Bool #

(/=) :: UTCTime -> UTCTime -> Bool #

Data UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

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 :: (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.Thyme.Clock.Internal

Read UTCTime # 
Instance details

Defined in Data.Thyme.Format

Show UTCTime # 
Instance details

Defined in Data.Thyme.LocalTime

Ix UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Generic UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Rep UTCTime :: Type -> Type #

Methods

from :: UTCTime -> Rep UTCTime x #

to :: Rep UTCTime x -> UTCTime #

Arbitrary UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

CoArbitrary UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

coarbitrary :: UTCTime -> Gen b -> Gen b #

ToJSON UTCTime # 
Instance details

Defined in Data.Thyme.Format.Aeson

FromJSON UTCTime # 
Instance details

Defined in Data.Thyme.Format.Aeson

NFData UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

rnf :: UTCTime -> () #

Random UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

randomR :: RandomGen g => (UTCTime, UTCTime) -> g -> (UTCTime, g) #

random :: RandomGen g => g -> (UTCTime, g) #

randomRs :: RandomGen g => (UTCTime, UTCTime) -> g -> [UTCTime] #

randoms :: RandomGen g => g -> [UTCTime] #

randomRIO :: (UTCTime, UTCTime) -> IO UTCTime #

randomIO :: IO UTCTime #

Unbox UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

AffineSpace UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Diff UTCTime :: Type #

ParseTime UTCTime # 
Instance details

Defined in Data.Thyme.Format

FormatTime UTCTime # 
Instance details

Defined in Data.Thyme.Format

Methods

showsTime :: TimeLocale -> UTCTime -> (Char -> ShowS) -> Char -> ShowS #

Vector Vector UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

MVector MVector UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Thyme UTCTime UTCTime # 
Instance details

Defined in Data.Thyme.Time.Core

Methods

thyme :: Iso' UTCTime0 UTCTime #

type Rep UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Rep UTCTime = D1 (MetaData "UTCTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-5fDUuKjOKkrCqjpykDCZJz" True) (C1 (MetaCons "UTCRep" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NominalDiffTime)))
newtype Vector UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Diff UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

newtype MVector s UTCTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

data UTCView #

Unpacked UTCView, partly for compatibility with time.

Constructors

UTCTime 

Fields

Instances
Eq UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

(==) :: UTCView -> UTCView -> Bool #

(/=) :: UTCView -> UTCView -> Bool #

Data UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

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

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

toConstr :: UTCView -> Constr #

dataTypeOf :: UTCView -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> UTCView -> UTCView #

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

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

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

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

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

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

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

Ord UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Read UTCView # 
Instance details

Defined in Data.Thyme.Format

Show UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Generic UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Rep UTCView :: Type -> Type #

Methods

from :: UTCView -> Rep UTCView x #

to :: Rep UTCView x -> UTCView #

NFData UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

rnf :: UTCView -> () #

Unbox UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Vector Vector UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

MVector MVector UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

Thyme UTCTime UTCView # 
Instance details

Defined in Data.Thyme.Time.Core

Methods

thyme :: Iso' UTCTime UTCView #

type Rep UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Rep UTCView = D1 (MetaData "UTCView" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-5fDUuKjOKkrCqjpykDCZJz" False) (C1 (MetaCons "UTCTime" PrefixI True) (S1 (MetaSel (Just "utctDay") SourceUnpack SourceStrict DecidedStrict) (Rec0 Day) :*: S1 (MetaSel (Just "utctDayTime") SourceUnpack SourceStrict DecidedStrict) (Rec0 DiffTime)))
newtype Vector UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

newtype MVector s UTCView # 
Instance details

Defined in Data.Thyme.Clock.Internal

utcTime :: Iso' UTCTime UTCView #

View UTCView as an UTCView, comprising a Day along with a DiffTime offset since midnight.

This is an improper lens: utctDayTime offsets outside the range of [zeroV, posixDayLength) will carry over into the day part, with the expected behaviour.

data NominalDiffTime #

A time interval as measured by UTC, that does not take leap-seconds into account.

For instance, the difference between 23:59:59 and 00:00:01 on the following day is always 2 seconds of NominalDiffTime, regardless of whether a leap-second took place.

NominalDiffTime forms an AdditiveGroup―so can be added using ^+^ (or ^-^ for subtraction), and also an instance of VectorSpace―so can be scaled using *^, where

type Scalar NominalDiffTime = Rational
Instances
Bounded NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Enum NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Eq NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Fractional NominalDiffTime # 
Instance details

Defined in Data.Thyme.Time

Data NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

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 :: (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.Thyme.Time

Ord NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Read NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Real NominalDiffTime # 
Instance details

Defined in Data.Thyme.Time

RealFrac NominalDiffTime # 
Instance details

Defined in Data.Thyme.Time

Show NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Ix NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Generic NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Rep NominalDiffTime :: Type -> Type #

Arbitrary NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

CoArbitrary NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

coarbitrary :: NominalDiffTime -> Gen b -> Gen b #

NFData NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

rnf :: NominalDiffTime -> () #

Random NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Unbox NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

HasBasis NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Basis NominalDiffTime :: Type #

VectorSpace NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Associated Types

type Scalar NominalDiffTime :: Type #

AdditiveGroup NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

TimeDiff NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Vector Vector NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

MVector MVector NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Thyme NominalDiffTime NominalDiffTime # 
Instance details

Defined in Data.Thyme.Time.Core

type Rep NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Rep NominalDiffTime = D1 (MetaData "NominalDiffTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-5fDUuKjOKkrCqjpykDCZJz" True) (C1 (MetaCons "NominalDiffTime" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Micro)))
newtype Vector NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Basis NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

type Scalar NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

newtype MVector s NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

getCurrentTime :: IO UTCTime #

Get the current UTC time from the system clock.

Time interval conversion

class (HasBasis t, Basis t ~ (), Scalar t ~ Rational) => TimeDiff t where #

Time intervals, encompassing both DiffTime and NominalDiffTime.

Issues
Still affected by http://hackage.haskell.org/trac/ghc/ticket/7611?

Methods

microseconds :: Iso' t Int64 #

Escape hatch; avoid.

Instances
TimeDiff DiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

Methods

microseconds :: Iso' DiffTime Int64 #

TimeDiff NominalDiffTime # 
Instance details

Defined in Data.Thyme.Clock.Internal

toSeconds :: (TimeDiff t, Fractional n) => t -> n #

Convert a time interval to some Fractional type.

fromSeconds :: (Real n, TimeDiff t) => n -> t #

Make a time interval from some Real type.

Performance
Try to make sure n is one of Float, Double, Int, Int64 or Integer, for which rewrite RULES have been provided.

toSeconds' :: TimeDiff t => t -> Rational #

Type-restricted toSeconds to avoid constraint-defaulting warnings.

fromSeconds' :: TimeDiff t => Rational -> t #

Type-restricted fromSeconds to avoid constraint-defaulting warnings.

Lenses

_utctDay :: Lens' UTCTime Day #

Lens' for the Day component of an UTCView.

_utctDayTime :: Lens' UTCTime DiffTime #

Lens' for the time-of-day component of an UTCView.