> 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 UTCUTCTime 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 UTCTo decompose a UTCTime into a separate Day and time-of-day, use utcTime. To convert to a local time zone, see zonedTime or utcLocalTime.
> view utcTime <$> getCurrentTime UTCView {utcvDay = 2016-01-15, utcvDayTime = 49322.287688s} > utcTime # UTCView (gregorian # YearMonthDay 2016 1 15) (timeOfDay # TimeOfDay 12 34 56.78) 2016-01-15 12:34:56.78 UTCWith {-# LANGUAGE ViewPatterns #-}, you can write: e.g.
f :: UTCTime -> (Day, DiffTime) f (view utcTime -> UTCView day dt) = (day, dt)
addUTCTime = flip (.+^) addUTCTime d t ≡ t .+^ dSee also the AffineSpace instance for UTCTime.
diffUTCTime = (.-.) diffUTCTime a b = a .-. bSee also the AffineSpace instance for UTCTime.
posixSecondsToUTCTime = review posixTime posixSecondsToUTCTime t ≡ posixTime # t
localToUTCTimeOfDay = addMinutes . negate . timeZoneMinutes