old-time-1.1.0.4: Time library
Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file libraries/old-time/LICENSE)
Maintainerlibraries@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

System.Time

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

data ClockTime Source #

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

Instances details
Show ClockTime Source # 
Instance details

Defined in System.Time

Eq ClockTime Source # 
Instance details

Defined in System.Time

Ord ClockTime Source # 
Instance details

Defined in System.Time

Time differences

data TimeDiff Source #

records the difference between two clock times in a user-readable way.

Constructors

TimeDiff 

Fields

Instances

Instances details
Read TimeDiff Source # 
Instance details

Defined in System.Time

Show TimeDiff Source # 
Instance details

Defined in System.Time

Eq TimeDiff Source # 
Instance details

Defined in System.Time

Ord TimeDiff Source # 
Instance details

Defined in System.Time

noTimeDiff :: TimeDiff Source #

null time difference.

diffClockTimes :: ClockTime -> ClockTime -> TimeDiff Source #

diffClockTimes t1 t2 returns the difference between two clock times t1 and t2 as a TimeDiff.

addToClockTime :: TimeDiff -> ClockTime -> ClockTime Source #

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.

normalizeTimeDiff :: TimeDiff -> TimeDiff Source #

converts a time difference to normal form.

timeDiffToString :: TimeDiff -> String Source #

formats time differences using local conventions.

formatTimeDiff :: TimeLocale -> String -> TimeDiff -> String Source #

formats time differences using local conventions and a formatting string. The formatting string is that understood by the ISO C strftime() function.

Calendar times

data CalendarTime Source #

CalendarTime is a user-readable and manipulable representation of the internal ClockTime type.

Constructors

CalendarTime 

Fields

data Month Source #

A month of the year.

Instances

Instances details
Bounded Month Source # 
Instance details

Defined in System.Time

Enum Month Source # 
Instance details

Defined in System.Time

Ix Month Source # 
Instance details

Defined in System.Time

Read Month Source # 
Instance details

Defined in System.Time

Show Month Source # 
Instance details

Defined in System.Time

Methods

showsPrec :: Int -> Month -> ShowS #

show :: Month -> String #

showList :: [Month] -> ShowS #

Eq Month Source # 
Instance details

Defined in System.Time

Methods

(==) :: Month -> Month -> Bool #

(/=) :: Month -> Month -> Bool #

Ord Month Source # 
Instance details

Defined in System.Time

Methods

compare :: Month -> Month -> Ordering #

(<) :: Month -> Month -> Bool #

(<=) :: Month -> Month -> Bool #

(>) :: Month -> Month -> Bool #

(>=) :: Month -> Month -> Bool #

max :: Month -> Month -> Month #

min :: Month -> Month -> Month #

data Day Source #

A day of the week.

Instances

Instances details
Bounded Day Source # 
Instance details

Defined in System.Time

Methods

minBound :: Day #

maxBound :: Day #

Enum Day Source # 
Instance details

Defined in System.Time

Methods

succ :: Day -> Day #

pred :: Day -> Day #

toEnum :: Int -> Day #

fromEnum :: Day -> Int #

enumFrom :: Day -> [Day] #

enumFromThen :: Day -> Day -> [Day] #

enumFromTo :: Day -> Day -> [Day] #

enumFromThenTo :: Day -> Day -> Day -> [Day] #

Ix Day Source # 
Instance details

Defined in System.Time

Methods

range :: (Day, Day) -> [Day] #

index :: (Day, Day) -> Day -> Int #

unsafeIndex :: (Day, Day) -> Day -> Int #

inRange :: (Day, Day) -> Day -> Bool #

rangeSize :: (Day, Day) -> Int #

unsafeRangeSize :: (Day, Day) -> Int #

Read Day Source # 
Instance details

Defined in System.Time

Show Day Source # 
Instance details

Defined in System.Time

Methods

showsPrec :: Int -> Day -> ShowS #

show :: Day -> String #

showList :: [Day] -> ShowS #

Eq Day Source # 
Instance details

Defined in System.Time

Methods

(==) :: Day -> Day -> Bool #

(/=) :: Day -> Day -> Bool #

Ord Day Source # 
Instance details

Defined in System.Time

Methods

compare :: Day -> Day -> Ordering #

(<) :: Day -> Day -> Bool #

(<=) :: Day -> Day -> Bool #

(>) :: Day -> Day -> Bool #

(>=) :: Day -> Day -> Bool #

max :: Day -> Day -> Day #

min :: Day -> Day -> Day #

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.

toClockTime :: CalendarTime -> ClockTime Source #

converts a CalendarTime into the corresponding internal ClockTime, ignoring the contents of the ctWDay, ctYDay, ctTZName and ctIsDST fields.

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.