> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# DA.Time

> Reference documentation for Daml module DA.Time.

Daml module

# DA.Time

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

Daml

[Updated 3.5.1](#history-updated-3-5-1)

Module
DA.Time

Latest release
3.7.5

## Data Types

### `data RelTime`

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

Instances:

* instance `Serializable` [`RelTime`](#type-da-time-types-reltime-23082)
* instance [`Eq`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-classes-eq-22713) [`RelTime`](#type-da-time-types-reltime-23082)
* instance [`Ord`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-classes-ord-6395) [`RelTime`](#type-da-time-types-reltime-23082)
* instance [`Bounded`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-enum-bounded-34379) [`RelTime`](#type-da-time-types-reltime-23082)
* instance [`Additive`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-num-additive-25881) [`RelTime`](#type-da-time-types-reltime-23082)
* instance [`Signed`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-num-signed-2671) [`RelTime`](#type-da-time-types-reltime-23082)
* instance [`Show`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-show-show-65360) [`RelTime`](#type-da-time-types-reltime-23082)

## Functions

### `time`

`time` : [`Date`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-date-32253) -> [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886)

`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`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`RelTime`](#type-da-time-types-reltime-23082) -> [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886)

Adjusts `Time` with given time offset.

### `subTime`

`subTime` : [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`RelTime`](#type-da-time-types-reltime-23082)

Returns time offset between two given instants.

### `wholeDays`

`wholeDays` : [`RelTime`](#type-da-time-types-reltime-23082) -> [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261)

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

### `days`

`days` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

A number of days in relative time.

### `hours`

`hours` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

A number of hours in relative time.

### `minutes`

`minutes` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

A number of minutes in relative time.

### `seconds`

`seconds` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

A number of seconds in relative time.

### `milliseconds`

`milliseconds` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

A number of milliseconds in relative time.

### `microseconds`

`microseconds` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

A number of microseconds in relative time.

### `convertRelTimeToMicroseconds`

`convertRelTimeToMicroseconds` : [`RelTime`](#type-da-time-types-reltime-23082) -> [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261)

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

### `convertMicrosecondsToRelTime`

`convertMicrosecondsToRelTime` : [`Int`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-int-37261) -> [`RelTime`](#type-da-time-types-reltime-23082)

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

### `isLedgerTimeLT`

`isLedgerTimeLT` : [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`Update`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-update-68072) [`Bool`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-bool-66265)

True iff the ledger time of the transaction is less than the given time.

### `isLedgerTimeLE`

`isLedgerTimeLE` : [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`Update`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-update-68072) [`Bool`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-bool-66265)

True iff the ledger time of the transaction is less than or equal to the given time.

### `isLedgerTimeGT`

`isLedgerTimeGT` : [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`Update`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-update-68072) [`Bool`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-bool-66265)

True iff the ledger time of the transaction is greater than the given time.

### `isLedgerTimeGE`

`isLedgerTimeGE` : [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886) -> [`Update`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-update-68072) [`Bool`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-ghc-types-bool-66265)

True iff the ledger time of the transaction is greater than or equal to the given time.

## Orphan Typeclass Instances

* instance [`Eq`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-classes-eq-22713) [`RelTime`](#type-da-time-types-reltime-23082)

* instance [`Ord`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-classes-ord-6395) [`RelTime`](#type-da-time-types-reltime-23082)

* instance [`Show`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-show-show-65360) [`RelTime`](#type-da-time-types-reltime-23082)

* instance [`Additive`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-num-additive-25881) [`RelTime`](#type-da-time-types-reltime-23082)

* instance [`Signed`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-num-signed-2671) [`RelTime`](#type-da-time-types-reltime-23082)

* instance [`Bounded`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-enum-bounded-34379) [`RelTime`](#type-da-time-types-reltime-23082)

* instance [`Bounded`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#class-ghc-enum-bounded-34379) [`Time`](https://docs.canton.network/appdev/reference/daml-standard-library/prelude#type-da-internal-lf-time-63886)

## History

Updated
`3.5.1`

Module declarations or documentation updated.
