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

Safe HaskellSafe-Inferred

Tiempo

Contents

Synopsis

Documentation

TimeInterval to different units and types

toMicroSeconds :: TimeInterval -> IntSource

converts the supplied TimeInterval to microseconds

toMilliSeconds :: TimeInterval -> DoubleSource

converts the supplied TimeInterval to milliseconds

toSeconds :: TimeInterval -> DoubleSource

converts the supplied TimeInterval to seconds

toMinutes :: TimeInterval -> DoubleSource

converts the supplied TimeInterval to minutes

toHours :: TimeInterval -> DoubleSource

converts the supplied TimeInterval to hours

toDays :: TimeInterval -> DoubleSource

converts the supplied TimeInterval to days

toNominalDiffTime :: TimeInterval -> NominalDiffTimeSource

converts the supplied TimeInterval to NominalDiffTime

Time manipulation

fromTime :: TimeInterval -> UTCTime -> UTCTimeSource

Adds TimeInterval to UTCTime returning a UTCTime in the future

fromNow :: TimeInterval -> IO UTCTimeSource

Adds TimeInterval to getCurrentTime returning a UTCTime in the future

agoTime :: TimeInterval -> UTCTime -> UTCTimeSource

Substracts TimeInterval from UTCTime returning a UTCTime in the past

ago :: TimeInterval -> IO UTCTimeSource

Substracts TimeInterval from getCurrentTime returning a UTCTime in the past

Unit functions

microSeconds :: Int -> TimeIntervalSource

given a number, produces a TimeInterval of microseconds

milliSeconds :: Int -> TimeIntervalSource

given a number, produces a TimeInterval of milliseconds

seconds :: Int -> TimeIntervalSource

given a number, produces a TimeInterval of seconds

minutes :: Int -> TimeIntervalSource

given a number, produces a TimeInterval of minutes

hours :: Int -> TimeIntervalSource

given a number, produces a TimeInterval of hours

days :: Int -> TimeIntervalSource

given a number, produces a TimeInterval of days