| 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
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.
A month of the year.
A day of the week.
data CalendarTime :: * Source
CalendarTime is a user-readable and manipulable
representation of the internal ClockTime type.
Constructors
| CalendarTime | |
Fields
| |
Instances
records the difference between two clock times in a user-readable way.
Constructors
| TimeDiff | |
addToClockTime :: TimeDiff -> ClockTime -> ClockTime Source
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 Source
returns the difference between two clock
times diffClockTimes t1 t2t1 and t2 as a TimeDiff.
toCalendarTime :: ClockTime -> IO CalendarTime Source
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 Source
converts an internal clock time into a CalendarTime in standard
UTC format.
calendarTimeToString :: CalendarTime -> String Source
formats calendar times using local conventions.
formatCalendarTime :: TimeLocale -> String -> CalendarTime -> String Source
formats calendar times using local conventions and a formatting string.
The formatting string is that understood by the ISO C strftime()
function.