temporal

The temporal module enables more sophisticated manipulation, conversion, and calculation of date and time. These functions handle temporal (time-related) operations and offer extended capabilities compared to the date functions.

docs-source (opens in a new tab)

TraitValue
Module typealgorithm
ImplementationC++
Graph directiondirected/undirected
Edge weightsweighted/unweighted
Parallelismsequential

Procedures

format(temporal, format)

Formats a temporal value.

Input:

  • temporal: Any ➡ temporal value (date, time, datetime, duration) to be formatted.
  • format: str ➡ the wanted format.

:::info

The format parameter supports values defined under Python strftime format codes (opens in a new tab).

:::

Output:

  • formatted: str ➡ received temporal value in the specified format.

Usage:

CALL temporal.format(duration({minute: 127}), "%H:%M:%S") YIELD formatted RETURN formatted;
+-----------------------+
| formatted             |
+-----------------------+
| "02:07:00"            |
+-----------------------+