Library for handling date and time information.
Author: Michael Hanus
Version: January 2018
ctYear
:: CalendarTime -> Int
The year of a calendar time. |
ctMonth
:: CalendarTime -> Int
The month of a calendar time. |
ctDay
:: CalendarTime -> Int
The day of a calendar time. |
ctHour
:: CalendarTime -> Int
The hour of a calendar time. |
ctMin
:: CalendarTime -> Int
The minute of a calendar time. |
ctSec
:: CalendarTime -> Int
The second of a calendar time. |
ctTZ
:: CalendarTime -> Int
The time zone of a calendar time. |
getClockTime
:: IO ClockTime
Returns the current clock time. |
getLocalTime
:: IO CalendarTime
Returns the local calendar time. |
clockTimeToInt
:: ClockTime -> Int
Transforms a clock time into a unique integer. |
toCalendarTime
:: ClockTime -> IO CalendarTime
Transforms a clock time into a calendar time according to the local time (if possible). |
toUTCTime
:: ClockTime -> CalendarTime
Transforms a clock time into a standard UTC calendar time. |
toClockTime
:: CalendarTime -> ClockTime
Transforms a calendar time (interpreted as UTC time) into a clock time. |
calendarTimeToString
:: CalendarTime -> String
Transforms a calendar time into a readable form. |
toDayString
:: CalendarTime -> String
Transforms a calendar time into a string containing the day, e.g., "September 23, 2006". |
toTimeString
:: CalendarTime -> String
Transforms a calendar time into a string containing the time. |
addSeconds
:: Int -> ClockTime -> ClockTime
Adds seconds to a given time. |
addMinutes
:: Int -> ClockTime -> ClockTime
Adds minutes to a given time. |
addHours
:: Int -> ClockTime -> ClockTime
Adds hours to a given time. |
addDays
:: Int -> ClockTime -> ClockTime
Adds days to a given time. |
addMonths
:: Int -> ClockTime -> ClockTime
Adds months to a given time. |
addYears
:: Int -> ClockTime -> ClockTime
Adds years to a given time. |
daysOfMonth
:: Int -> Int -> Int
Gets the days of a month in a year. |
validDate
:: Int -> Int -> Int -> Bool
Is a date consisting of year/month/day valid? |
compareDate
:: CalendarTime -> CalendarTime -> Ordering
Compares two dates (don't use it, just for backward compatibility!). |
compareCalendarTime
:: CalendarTime -> CalendarTime -> Ordering
Compares two calendar times. |
compareClockTime
:: ClockTime -> ClockTime -> Ordering
Compares two clock times. |
ClockTime represents a clock time in some internal representation.
Constructors:
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
The year of a calendar time.
|
The month of a calendar time.
|
The day of a calendar time.
|
The hour of a calendar time.
|
The minute of a calendar time.
|
The second of a calendar time.
|
The time zone of a calendar time. The value of the time zone is the difference to UTC time in seconds.
|
Returns the current clock time.
|
Returns the local calendar time. |
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.
|
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. |
Transforms a clock time into a standard UTC calendar time. Thus, this operation is independent on the local time. |
Transforms a calendar time (interpreted as UTC time) into a clock time. |
Transforms a calendar time into a readable form. |
Transforms a calendar time into a string containing the day, e.g., "September 23, 2006". |
Transforms a calendar time into a string containing the time. |
Adds seconds to a given time. |
Adds minutes to a given time. |
Gets the days of a month in a year. |
Is a date consisting of year/month/day valid? |
Compares two dates (don't use it, just for backward compatibility!). |
Compares two calendar times. |
Compares two clock times. |