tiempo-0.0.1.1: Specify time intervals in different units (secs, mins, hours, etc.)

Safe HaskellSafe-Inferred
LanguageHaskell2010

Tiempo

Contents

Synopsis

Documentation

TimeInterval to different units and types

toMicroSeconds :: TimeInterval -> Int Source

converts the supplied TimeInterval to microseconds

toMilliSeconds :: TimeInterval -> Double Source

converts the supplied TimeInterval to milliseconds

toSeconds :: TimeInterval -> Double Source

converts the supplied TimeInterval to seconds

toMinutes :: TimeInterval -> Double Source

converts the supplied TimeInterval to minutes

toHours :: TimeInterval -> Double Source

converts the supplied TimeInterval to hours

toDays :: TimeInterval -> Double Source

converts the supplied TimeInterval to days

toNominalDiffTime :: TimeInterval -> NominalDiffTime Source

converts the supplied TimeInterval to NominalDiffTime

Time manipulation

fromTime :: TimeInterval -> UTCTime -> UTCTime Source

Adds TimeInterval to UTCTime returning a UTCTime in the future

fromNow :: TimeInterval -> IO UTCTime Source

Adds TimeInterval to getCurrentTime returning a UTCTime in the future

agoTime :: TimeInterval -> UTCTime -> UTCTime Source

Substracts TimeInterval from UTCTime returning a UTCTime in the past

ago :: TimeInterval -> IO UTCTime Source

Substracts TimeInterval from getCurrentTime returning a UTCTime in the past

Unit functions

microSeconds :: Int -> TimeInterval Source

given a number, produces a TimeInterval of microseconds

milliSeconds :: Int -> TimeInterval Source

given a number, produces a TimeInterval of milliseconds

seconds :: Int -> TimeInterval Source

given a number, produces a TimeInterval of seconds

minutes :: Int -> TimeInterval Source

given a number, produces a TimeInterval of minutes

hours :: Int -> TimeInterval Source

given a number, produces a TimeInterval of hours

days :: Int -> TimeInterval Source

given a number, produces a TimeInterval of days