Coördinated universal time
(UTCTime) is the most commonly used standard for civil timekeeping. It
is synchronised with
TAI
(Data.Thyme.Clock.AbsoluteTime) and both tick in increments of SI
seconds, but UTC includes occasional leap-seconds to keep it close to
UT1
(UniversalTime).
> utcTime # UTCView (gregorian # YearMonthDay 2016 1 15) (timeOfDay # TimeOfDay 12 34 56.78)
2016-01-15 12:34:56.78 UTC
> UTCTime (gregorian # YearMonthDay 2016 1 15) (timeOfDay # TimeOfDay 12 34 56.78)
2016-01-15 12:34:56.78 UTC
> mkUTCTime 2016 1 15 12 34 56.78
2016-01-15 12:34:56.78 UTC
UTCTime is an AffineSpace with NominalDiffTime as its Diff. See
Data.Thyme.Docs#spaces for details.
> let t0 = mkUTCTime 2016 1 15 23 59 0
> let t1 = mkUTCTime 2016 1 16 00 1 1
> let dt = t1 .-. t0
> dt
121s :: NominalDiffTime
> t1 .+^ dt
2016-01-16 00:03:02 UTC
> t1 .+^ 3 *^ dt
2016-01-16 00:07:04 UTC
To decompose a UTCTime into a separate Day and time-of-day, use
utcTime. To convert to a local time zone, see
zonedTime or utcLocalTime.
Notes
Internally UTCTime is just a 64-bit count of microseconds since the
Modified Julian Day epoch, so (.+^), (.-.) et cetera ought to be
fast.
UTCTime cannot represent leap seconds.
If leap seconds matter, use AbsoluteTime from
Data.Thyme.Clock.TAI instead, along with
absoluteTime' and UTCView for presentation.
Instances27Bounded, Enum, Eq, Data, Ord, Read, …
Bounded UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalEnum UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalEq UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalData UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalOrd UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalRead UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Format · orphanShow UTCTimeDefined in thyme-0.4.1 · Data.Thyme.LocalTime · orphanIx UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalGeneric UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalNFData UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalRandom UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalArbitrary UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalCoArbitrary UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalHashable UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalUnbox UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalFromJSON UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Format.Aeson · orphanToJSON UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Format.Aeson · orphanAffineSpace UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalFormatTime UTCTimeDefined in thyme-0.4.1 · Data.Thyme.FormatParseTime UTCTimeDefined in thyme-0.4.1 · Data.Thyme.FormatMVector MVector UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalVector Vector UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.InternalThyme UTCTime UTCTimeDefined in thyme-0.4.1 · Data.Thyme.Time.Coretype Rep UTCTime = D1 ('MetaDataDefined in thyme-0.4.1 · Data.Thyme.Clock.Internal"UTCTime"
"Data.Thyme.Clock.Internal"
"thyme-0.4.1-Hondpx62VKYKZpcBdXvlb4"
'True) (C1 ('MetaCons"UTCRep"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime)))data MVector s UTCTimeMV_UTCTime (MVector s NominalDiffTime)
data Vector UTCTimeV_UTCTime (Vector NominalDiffTime)
type Diff UTCTime = NominalDiffTimeDefined in thyme-0.4.1 · Data.Thyme.Clock.Internal