> 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.
>>> input utcTime "2020-01-01T12:34:56+02:00" 2020-01-01 10:34:56 UTC
>>> import qualified Data.Text as T >>> c1 <- calendar (T.pack "CET") (Locale "de_DE") TraditionalCalendarType >>> show c1 2021-10-12 18:00:50 >>> utcTime c1 2021-10-12 16:00:50.544999999998 UTC
> 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)