Skip to main content

Daml module

DA.Time

This module provides a set of functions to manipulate Time values.

Data Types

data RelTime

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

Functions

time

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

addRelTime : Time -> RelTime -> Time Adjusts Time with given time offset.

subTime

subTime : Time -> Time -> RelTime Returns time offset between two given instants.

wholeDays

wholeDays : RelTime -> Int Returns the number of whole days in a time offset. Fraction of time is rounded towards zero.

days

days : Int -> RelTime A number of days in relative time.

hours

hours : Int -> RelTime A number of hours in relative time.

minutes

minutes : Int -> RelTime A number of minutes in relative time.

seconds

seconds : Int -> RelTime A number of seconds in relative time.

milliseconds

milliseconds : Int -> RelTime A number of milliseconds in relative time.

microseconds

microseconds : Int -> RelTime A number of microseconds in relative time.

convertRelTimeToMicroseconds

convertRelTimeToMicroseconds : RelTime -> Int Convert RelTime to microseconds Use higher level functions instead of the internal microseconds

convertMicrosecondsToRelTime

convertMicrosecondsToRelTime : Int -> RelTime Convert microseconds to RelTime Use higher level functions instead of the internal microseconds

isLedgerTimeLT

isLedgerTimeLT : Time -> Update Bool True iff the ledger time of the transaction is less than the given time.

isLedgerTimeLE

isLedgerTimeLE : Time -> Update Bool True iff the ledger time of the transaction is less than or equal to the given time.

isLedgerTimeGT

isLedgerTimeGT : Time -> Update Bool True iff the ledger time of the transaction is greater than the given time.

isLedgerTimeGE

isLedgerTimeGE : Time -> Update Bool True iff the ledger time of the transaction is greater than or equal to the given time.

Orphan Typeclass Instances

History

Updated3.5.1

Module declarations or documentation updated.

Added3.4.9