| Safe Haskell | Trustworthy |
|---|---|
| Language | Haskell98 |
Time
- data ClockTime :: *
- data Month :: *
- data Day :: *
- data CalendarTime :: * = CalendarTime {}
- data TimeDiff :: * = TimeDiff {}
- getClockTime :: IO ClockTime
- addToClockTime :: TimeDiff -> ClockTime -> ClockTime
- diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
- toCalendarTime :: ClockTime -> IO CalendarTime
- toUTCTime :: ClockTime -> CalendarTime
- toClockTime :: CalendarTime -> ClockTime
- calendarTimeToString :: CalendarTime -> String
- formatCalendarTime :: TimeLocale -> String -> CalendarTime -> String
Documentation
data ClockTime :: *
A representation of the internal clock time.
Clock times may be compared, converted to strings, or converted to an
external calendar time CalendarTime for I/O or other manipulations.
data Month :: *
A month of the year.
data Day :: *
A day of the week.
data CalendarTime :: *
CalendarTime is a user-readable and manipulable
representation of the internal ClockTime type.
Constructors
| CalendarTime | |
Fields
| |
Instances
data TimeDiff :: *
records the difference between two clock times in a user-readable way.
Constructors
| TimeDiff | |
addToClockTime :: TimeDiff -> ClockTime -> ClockTime
adds a time difference addToClockTime d td and a
clock time t to yield a new clock time. The difference d
may be either positive or negative.
diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
returns the difference between two clock
times diffClockTimes t1 t2t1 and t2 as a TimeDiff.
toCalendarTime :: ClockTime -> IO CalendarTime
converts an internal clock time to a local time, modified by the
timezone and daylight savings time settings in force at the time
of conversion. Because of this dependence on the local environment,
toCalendarTime is in the IO monad.
toUTCTime :: ClockTime -> CalendarTime
converts an internal clock time into a CalendarTime in standard
UTC format.
toClockTime :: CalendarTime -> ClockTime
calendarTimeToString :: CalendarTime -> String
formats calendar times using local conventions.
formatCalendarTime :: TimeLocale -> String -> CalendarTime -> String
formats calendar times using local conventions and a formatting string.
The formatting string is that understood by the ISO C strftime()
function.