module Data.Time.Clock.Internal.UTCDiff where
import Data.Time.Clock.Internal.NominalDiffTime
import Data.Time.Clock.Internal.UTCTime
import Data.Time.Clock.POSIX
addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
addUTCTime NominalDiffTime
x UTCTime
t = NominalDiffTime -> UTCTime
posixSecondsToUTCTime (NominalDiffTime
x NominalDiffTime -> NominalDiffTime -> NominalDiffTime
forall a. Num a => a -> a -> a
+ (UTCTime -> NominalDiffTime
utcTimeToPOSIXSeconds UTCTime
t))
diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
diffUTCTime UTCTime
a UTCTime
b = (UTCTime -> NominalDiffTime
utcTimeToPOSIXSeconds UTCTime
a) NominalDiffTime -> NominalDiffTime -> NominalDiffTime
forall a. Num a => a -> a -> a
- (UTCTime -> NominalDiffTime
utcTimeToPOSIXSeconds UTCTime
b)