Module "Time.curry"

Library for handling date and time information.

Author: Michael Hanus

Version: April 2007


 Exported names:

Datatypes:
CalendarTime | ClockTime

Constructors:
CalendarTime

Functions:
addDays | addHours | addMinutes | addMonths | addSeconds | addYears | calendarTimeToString | clockTimeToInt | compareCalendarTime | compareClockTime | compareDate | ctDay | ctHour | ctMin | ctMonth | ctSec | ctTZ | ctYear | daysOfMonth | getClockTime | getLocalTime | toCalendarTime | toClockTime | toDayString | toTimeString | toUTCTime | validDate


 Summary of exported functions:

ctYear  :: CalendarTime -> Int  deterministic flexible
          The year of a calendar time.
ctMonth  :: CalendarTime -> Int  deterministic flexible
          The month of a calendar time.
ctDay  :: CalendarTime -> Int  deterministic flexible
          The day of a calendar time.
ctHour  :: CalendarTime -> Int  deterministic flexible
          The hour of a calendar time.
ctMin  :: CalendarTime -> Int  deterministic flexible
          The minute of a calendar time.
ctSec  :: CalendarTime -> Int  deterministic flexible
          The second of a calendar time.
ctTZ  :: CalendarTime -> Int  deterministic flexible
          The time zone of a calendar time.
getClockTime  :: IO ClockTime  deterministic 
          Returns the current clock time.
getLocalTime  :: IO CalendarTime  deterministic 
          Returns the local calendar time.
clockTimeToInt  :: ClockTime -> Int  deterministic flexible
          Transforms a clock time into a unique integer.
toCalendarTime  :: ClockTime -> IO CalendarTime  deterministic 
          Transforms a clock time into a calendar time according to the local time (if possible).
toUTCTime  :: ClockTime -> CalendarTime  deterministic 
          Transforms a clock time into a standard UTC calendar time.
toClockTime  :: CalendarTime -> ClockTime  deterministic 
          Transforms a calendar time (interpreted as UTC time) into a clock time.
calendarTimeToString  :: CalendarTime -> String  deterministic flexible
          Transforms a calendar time into a readable form.
toDayString  :: CalendarTime -> String  deterministic flexible
          Transforms a calendar time into a string containing the day, e.g., "September 23, 2006".
toTimeString  :: CalendarTime -> String  deterministic flexible
          Transforms a calendar time into a string containing the time.
addSeconds  :: Int -> ClockTime -> ClockTime  deterministic flexible
          Adds seconds to a given time.
addMinutes  :: Int -> ClockTime -> ClockTime  deterministic flexible
          Adds minutes to a given time.
addHours  :: Int -> ClockTime -> ClockTime  deterministic flexible
          Adds hours to a given time.
addDays  :: Int -> ClockTime -> ClockTime  deterministic flexible
          Adds days to a given time.
addMonths  :: Int -> ClockTime -> ClockTime  deterministic rigid
          Adds months to a given time.
addYears  :: Int -> ClockTime -> ClockTime  deterministic rigid
          Adds years to a given time.
daysOfMonth  :: Int -> Int -> Int  deterministic rigid
          Gets the days of a month in a year.
validDate  :: Int -> Int -> Int -> Bool  deterministic 
          Is a date consisting of year/month/day valid?
compareDate  :: CalendarTime -> CalendarTime -> Ordering  deterministic 
          Compares two dates (don't use it, just for backward compatibility!).
compareCalendarTime  :: CalendarTime -> CalendarTime -> Ordering  deterministic 
          Compares two calendar times.
compareClockTime  :: ClockTime -> ClockTime -> Ordering  deterministic flexible+rigid
          Compares two clock times.

 Imported modules:

Prelude

 Exported datatypes:

ClockTime

ClockTime represents a clock time in some internal representation.

Constructors:


CalendarTime

A calendar time is presented in the following form: (CalendarTime year month day hour minute second timezone) where timezone is an integer representing the timezone as a difference to UTC time in seconds.

Constructors:

CalendarTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> CalendarTime



 Exported functions:

ctYear :: CalendarTime -> Int  deterministic flexible

The year of a calendar time.

Further infos:
  • solution complete, i.e., able to compute all solutions

ctMonth :: CalendarTime -> Int  deterministic flexible

The month of a calendar time.

Further infos:
  • solution complete, i.e., able to compute all solutions

ctDay :: CalendarTime -> Int  deterministic flexible

The day of a calendar time.

Further infos:
  • solution complete, i.e., able to compute all solutions

ctHour :: CalendarTime -> Int  deterministic flexible

The hour of a calendar time.

Further infos:
  • solution complete, i.e., able to compute all solutions

ctMin :: CalendarTime -> Int  deterministic flexible

The minute of a calendar time.

Further infos:
  • solution complete, i.e., able to compute all solutions

ctSec :: CalendarTime -> Int  deterministic flexible

The second of a calendar time.

Further infos:
  • solution complete, i.e., able to compute all solutions

ctTZ :: CalendarTime -> Int  deterministic flexible

The time zone of a calendar time. The value of the time zone is the difference to UTC time in seconds.

Further infos:
  • solution complete, i.e., able to compute all solutions

getClockTime :: IO ClockTime  deterministic 

Returns the current clock time.

Further infos:
  • externally defined

getLocalTime :: IO CalendarTime  deterministic 

Returns the local calendar time.


clockTimeToInt :: ClockTime -> Int  deterministic flexible

Transforms a clock time into a unique integer. It is ensured that clock times that differs in at least one second are mapped into different integers.

Further infos:
  • solution complete, i.e., able to compute all solutions

toCalendarTime :: ClockTime -> IO CalendarTime  deterministic 

Transforms a clock time into a calendar time according to the local time (if possible). Since the result depends on the local environment, it is an I/O operation.


toUTCTime :: ClockTime -> CalendarTime  deterministic 

Transforms a clock time into a standard UTC calendar time. Thus, this operationa is independent on the local time.


toClockTime :: CalendarTime -> ClockTime  deterministic 

Transforms a calendar time (interpreted as UTC time) into a clock time.


calendarTimeToString :: CalendarTime -> String  deterministic flexible

Transforms a calendar time into a readable form.


toDayString :: CalendarTime -> String  deterministic flexible

Transforms a calendar time into a string containing the day, e.g., "September 23, 2006".


toTimeString :: CalendarTime -> String  deterministic flexible

Transforms a calendar time into a string containing the time.


addSeconds :: Int -> ClockTime -> ClockTime  deterministic flexible

Adds seconds to a given time.


addMinutes :: Int -> ClockTime -> ClockTime  deterministic flexible

Adds minutes to a given time.


addHours :: Int -> ClockTime -> ClockTime  deterministic flexible

Adds hours to a given time.


addDays :: Int -> ClockTime -> ClockTime  deterministic flexible

Adds days to a given time.


addMonths :: Int -> ClockTime -> ClockTime  deterministic rigid

Adds months to a given time.


addYears :: Int -> ClockTime -> ClockTime  deterministic rigid

Adds years to a given time.

Further infos:
  • incompletely defined

daysOfMonth :: Int -> Int -> Int  deterministic rigid

Gets the days of a month in a year.

Further infos:
  • incompletely defined

validDate :: Int -> Int -> Int -> Bool  deterministic 

Is a date consisting of year/month/day valid?


compareDate :: CalendarTime -> CalendarTime -> Ordering  deterministic 

Compares two dates (don't use it, just for backward compatibility!).


compareCalendarTime :: CalendarTime -> CalendarTime -> Ordering  deterministic 

Compares two calendar times.


compareClockTime :: ClockTime -> ClockTime -> Ordering  deterministic flexible+rigid

Compares two clock times.

Further infos:
  • incompletely defined


Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Aug 28 15:25:48 2008