Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Data.Time.Format.Human
Description
Print a
as "a few seconds ago" or "3 days ago" and similar.UTCTime
- humanReadableTime :: UTCTime -> IO String
- humanReadableTime' :: UTCTime -> UTCTime -> String
- humanReadableTimeI18N :: HumanTimeLocale -> UTCTime -> IO String
- humanReadableTimeI18N' :: HumanTimeLocale -> UTCTime -> UTCTime -> String
- data HumanTimeLocale = HumanTimeLocale {
- justNow :: String
- secondsAgo :: Bool -> String -> String
- oneMinuteAgo :: Bool -> String
- minutesAgo :: Bool -> String -> String
- oneHourAgo :: Bool -> String
- aboutHoursAgo :: Bool -> String -> String
- at :: Int -> String -> String
- daysAgo :: Bool -> String -> String
- weekAgo :: Bool -> String -> String
- weeksAgo :: Bool -> String -> String
- onYear :: String -> String
- locale :: TimeLocale
- timeZone :: TimeZone
- dayOfWeekFmt :: String
- thisYearFmt :: String
- prevYearFmt :: String
- defaultHumanTimeLocale :: HumanTimeLocale
Documentation
humanReadableTime :: UTCTime -> IO String Source #
Based on humanReadableTimeDiff
found in
https://github.com/snoyberg/haskellers/blob/master/Haskellers.hs,
https://github.com/snoyberg/haskellers/blob/master/LICENSE
A pure form, takes current time as an argument
humanReadableTimeI18N :: HumanTimeLocale -> UTCTime -> IO String Source #
I18N version of humanReadableTime
humanReadableTimeI18N' Source #
Arguments
:: HumanTimeLocale | |
-> UTCTime | current time |
-> UTCTime | |
-> String |
I18N version of humanReadableTime'
data HumanTimeLocale Source #
Constructors
HumanTimeLocale | |
Fields
|
defaultHumanTimeLocale :: HumanTimeLocale Source #
Default human time locale uses English.