time-compat-1.9.8: Compatibility package for time
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Time.Clock.Compat

Synopsis

Universal Time

Time as measured by the Earth.

newtype UniversalTime Source #

The Modified Julian Date is the day with the fraction of the day, measured from UT midnight. It's used to represent UT1, which is time as measured by the earth's rotation, adjusted for various wobbles.

Constructors

ModJulianDate 

Instances

Instances details
NFData UniversalTime 
Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

rnf :: UniversalTime -> () Source #

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 Source #

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

toConstr :: UniversalTime -> Constr Source #

dataTypeOf :: UniversalTime -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic UniversalTime Source # 
Instance details

Defined in Data.Time.Orphans

Associated Types

type Rep UniversalTime 
Instance details

Defined in Data.Time.Orphans

type Rep UniversalTime = D1 ('MetaData "UniversalTime" "Data.Time.Clock.Internal.UniversalTime" "time-1.12.2-8bd5" 'True) (C1 ('MetaCons "ModJulianDate" 'PrefixI 'True) (S1 ('MetaSel ('Just "getModJulianDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))
Read UniversalTime 
Instance details

Defined in Data.Time.Format.Parse

Show UniversalTime 
Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Eq UniversalTime 
Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Ord UniversalTime 
Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Hashable UniversalTime Source # 
Instance details

Defined in Data.Time.Orphans

FormatTime UniversalTime 
Instance details

Defined in Data.Time.Format.Format.Instances

ParseTime UniversalTime 
Instance details

Defined in Data.Time.Format.Parse.Instances

Lift UniversalTime Source # 
Instance details

Defined in Data.Time.Orphans

Methods

lift :: Quote m => UniversalTime -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => UniversalTime -> Code m UniversalTime Source #

type Rep UniversalTime Source # 
Instance details

Defined in Data.Time.Orphans

type Rep UniversalTime = D1 ('MetaData "UniversalTime" "Data.Time.Clock.Internal.UniversalTime" "time-1.12.2-8bd5" 'True) (C1 ('MetaCons "ModJulianDate" 'PrefixI 'True) (S1 ('MetaSel ('Just "getModJulianDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))

Absolute intervals, DiffTime

data DiffTime Source #

This is a length of time, as measured by a clock. Conversion functions such as fromInteger and realToFrac will treat it as seconds. For example, (0.010 :: DiffTime) corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

Instances

Instances details
NFData DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

rnf :: DiffTime -> () Source #

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 Source #

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

toConstr :: DiffTime -> Constr Source #

dataTypeOf :: DiffTime -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Enum DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Num DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Read DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Fractional DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Real DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

RealFrac DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Show DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Eq DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Ord DiffTime 
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Hashable DiffTime Source # 
Instance details

Defined in Data.Time.Orphans

FormatTime DiffTime 
Instance details

Defined in Data.Time.Format.Format.Instances

ParseTime DiffTime 
Instance details

Defined in Data.Time.Format.Parse.Instances

Lift DiffTime Source # 
Instance details

Defined in Data.Time.Orphans

Methods

lift :: Quote m => DiffTime -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => DiffTime -> Code m DiffTime Source #

secondsToDiffTime :: Integer -> DiffTime Source #

Create a DiffTime which represents an integral number of seconds.

picosecondsToDiffTime :: Integer -> DiffTime Source #

Create a DiffTime from a number of picoseconds.

diffTimeToPicoseconds :: DiffTime -> Integer Source #

Get the number of picoseconds in a DiffTime.

UTCTime

data UTCTime Source #

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Constructors

UTCTime 

Fields

Instances

Instances details
NFData UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

rnf :: UTCTime -> () Source #

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 Source #

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

toConstr :: UTCTime -> Constr Source #

dataTypeOf :: UTCTime -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic UTCTime Source # 
Instance details

Defined in Data.Time.Orphans

Associated Types

type Rep UTCTime 
Instance details

Defined in Data.Time.Orphans

type Rep UTCTime = D1 ('MetaData "UTCTime" "Data.Time.Clock.Internal.UTCTime" "time-1.12.2-8bd5" 'False) (C1 ('MetaCons "UTCTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "utctDay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just "utctDayTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DiffTime)))
Read UTCTime 
Instance details

Defined in Data.Time.Format.Parse

Show UTCTime 
Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

Eq UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Ord UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Hashable UTCTime Source # 
Instance details

Defined in Data.Time.Orphans

FormatTime UTCTime 
Instance details

Defined in Data.Time.Format.Format.Instances

ISO8601 UTCTime

yyyy-mm-ddThh:mm:ss[.sss]Z (ISO 8601:2004(E) sec. 4.3.2 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ParseTime UTCTime 
Instance details

Defined in Data.Time.Format.Parse.Instances

Lift UTCTime Source # 
Instance details

Defined in Data.Time.Orphans

Methods

lift :: Quote m => UTCTime -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => UTCTime -> Code m UTCTime Source #

type Rep UTCTime Source # 
Instance details

Defined in Data.Time.Orphans

type Rep UTCTime = D1 ('MetaData "UTCTime" "Data.Time.Clock.Internal.UTCTime" "time-1.12.2-8bd5" 'False) (C1 ('MetaCons "UTCTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "utctDay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just "utctDayTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DiffTime)))

NominalDiffTime

data NominalDiffTime Source #

This is a length of time, as measured by UTC. It has a precision of 10^-12 s.

Conversion functions such as fromInteger and realToFrac will treat it as seconds. For example, (0.010 :: NominalDiffTime) corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

Instances

Instances details
NFData NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

rnf :: NominalDiffTime -> () Source #

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 Source #

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

toConstr :: NominalDiffTime -> Constr Source #

dataTypeOf :: NominalDiffTime -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Enum NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Num NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Read NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Fractional NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Real NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

RealFrac NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Show NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Eq NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Ord NominalDiffTime 
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Hashable NominalDiffTime Source # 
Instance details

Defined in Data.Time.Orphans

FormatTime NominalDiffTime 
Instance details

Defined in Data.Time.Format.Format.Instances

ParseTime NominalDiffTime 
Instance details

Defined in Data.Time.Format.Parse.Instances

Lift NominalDiffTime Source # 
Instance details

Defined in Data.Time.Orphans

secondsToNominalDiffTime :: Pico -> NominalDiffTime Source #

Create a NominalDiffTime from a number of seconds.

Since: time-1.9.1

nominalDiffTimeToSeconds :: NominalDiffTime -> Pico Source #

Get the seconds in a NominalDiffTime.

Since: time-1.9.1

UTC differences

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime Source #

addUTCTime a b = a + b

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime Source #

diffUTCTime a b = a - b

Current time

getCurrentTime :: IO UTCTime Source #

Get the current UTCTime from the system clock.

getTime_resolution :: DiffTime Source #

The resolution of getSystemTime, getCurrentTime, getPOSIXTime. On UNIX systems this uses clock_getres, which may be wrong on WSL2.

Type aliases

type Year = Integer Source #

Year of Common Era (when positive).

type MonthOfYear = Int Source #

Month of year, in range 1 (January) to 12 (December).

type DayOfMonth = Int Source #

Day of month, in range 1 to 31.