DA.Time

This module provides a set of functions to manipulate Time values. The Time type represents a specific datetime in UTC, for example time (date 2007 Apr 5) 14 30 05. The bounds for Time are 0001-01-01T00:00:00.000000Z and 9999-12-31T23:59:59.999999Z.

Data Types

data RelTime

The RelTime type describes a time offset, i.e. relative time.

instance Eq RelTime

instance Ord RelTime

instance Bounded RelTime

instance Additive RelTime

instance Signed RelTime

instance Show RelTime

Functions

time

: Date -> Int -> Int -> Int -> Time

time d h m s turns given UTC date d and the UTC time (given in hours, minutes, seconds) into a UTC timestamp (Time). Does not handle leap seconds.

addRelTime

: Time -> RelTime -> Time

Adjusts Time with given time offset.

subTime

: Time -> Time -> RelTime

Returns time offset between two given instants.

wholeDays

: RelTime -> Int

Returns the number of whole days in a time offset. Fraction of time is rounded towards zero.

days

: Int -> RelTime

A number of days in relative time.

hours

: Int -> RelTime

A number of hours in relative time.

minutes

: Int -> RelTime

A number of minutes in relative time.

seconds

: Int -> RelTime

A number of seconds in relative time.

milliseconds

: Int -> RelTime

A number of milliseconds in relative time.

microseconds

: Int -> RelTime

A number of microseconds in relative time.

convertRelTimeToMicroseconds

: RelTime -> Int

Convert RelTime to microseconds Use higher level functions instead of the internal microseconds

convertMicrosecondsToRelTime

: Int -> RelTime

Convert microseconds to RelTime Use higher level functions instead of the internal microseconds