|
System.Time | Portability | portable | Stability | provisional | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
The standard time library from Haskell 98. This library is
deprecated, please look at Data.Time in the time package
instead.
System.Time provides functionality for clock times, including
timezone information (i.e, the functionality of "time.h",
adapted to the Haskell environment). It follows RFC 1129 in its
use of Coordinated Universal Time (UTC).
|
|
Synopsis |
|
|
|
|
Clock times
|
|
|
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.
| Constructors | TOD Integer Integer | Construct a clock time. The arguments are a number
of seconds since 00:00:00 (UTC) on 1 January 1970,
and an additional number of picoseconds.
In Haskell 98, the ClockTime type is abstract.
|
| Instances | |
|
|
|
|
Time differences
|
|
|
records the difference between two clock times in a user-readable way.
| Constructors | | Instances | |
|
|
|
null time difference.
|
|
|
diffClockTimes t1 t2 returns the difference between two clock
times t1 and t2 as a TimeDiff.
|
|
|
addToClockTime d t adds a time difference d and a
clock time t to yield a new clock time. The difference d
may be either positive or negative.
|
|
|
converts a time difference to normal form.
|
|
|
formats time differences using local conventions.
|
|
|
formats time differences using local conventions and a formatting string.
The formatting string is that understood by the ISO C strftime()
function.
|
|
Calendar times
|
|
|
CalendarTime is a user-readable and manipulable
representation of the internal ClockTime type.
| Constructors | CalendarTime | | ctYear :: Int | Year (pre-Gregorian dates are inaccurate)
| ctMonth :: Month | Month of the year
| ctDay :: Int | Day of the month (1 to 31)
| ctHour :: Int | Hour of the day (0 to 23)
| ctMin :: Int | Minutes (0 to 59)
| ctSec :: Int | Seconds (0 to 61, allowing for up to
two leap seconds)
| ctPicosec :: Integer | Picoseconds
| ctWDay :: Day | Day of the week
| ctYDay :: Int | Day of the year
(0 to 364, or 365 in leap years)
| ctTZName :: String | Name of the time zone
| ctTZ :: Int | Variation from UTC in seconds
| ctIsDST :: Bool | True if Daylight Savings Time would
be in effect, and False otherwise
|
|
| Instances | |
|
|
|
A month of the year.
| Constructors | January | | February | | March | | April | | May | | June | | July | | August | | September | | October | | November | | December | |
| Instances | |
|
|
|
A day of the week.
| Constructors | Sunday | | Monday | | Tuesday | | Wednesday | | Thursday | | Friday | | Saturday | |
| Instances | |
|
|
|
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.
|
|
|
converts an internal clock time into a CalendarTime in standard
UTC format.
|
|
|
converts a CalendarTime into the corresponding internal
ClockTime, ignoring the contents of the ctWDay, ctYDay,
ctTZName and ctIsDST fields.
|
|
|
formats calendar times using local conventions.
|
|
|
formats calendar times using local conventions and a formatting string.
The formatting string is that understood by the ISO C strftime()
function.
|
|
Produced by Haddock version 2.6.1 |