data-extra-2.3.0: Extra utilities for working on Data.* types.

Safe HaskellNone

Data.Time.Extra

Description

Extra date functions.

Synopsis

Documentation

getYear :: FormatTime t => t -> IntegerSource

Get the current year.

getMonth :: FormatTime t => t -> IntegerSource

Get the current month.

getDay :: FormatTime t => t -> IntegerSource

Get the current day.

relativeSource

Arguments

:: UTCTime

The later time span.

-> UTCTime

The earlier time span.

-> Bool

Display 'in/ago'?

-> Text

Example: '3 seconds ago', 'in three days'.

Display a time span as one time relative to another.

stopwatch :: MonadIO m => m a -> m (a, NominalDiffTime)Source

Run a stop-watch at the start and end of a computation.

bench :: MonadIO m => Integer -> m a -> m (a, NominalDiffTime)Source

Trivial benchmark for some monadic action.