# 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`](date.md)
functions.

| Trait               | Value               |
| ------------------- | ------------------- |
| **Module type**     | util                |
| **Implementation**  | C++                 |
| **Graph direction** | directed/undirected |
| **Edge weights**    | weighted/unweighted |
| **Parallelism**     | sequential          |

## Procedures

### `format()`

The procedure formats a temporal value.

#### Input:

- `temporal: Any` ➡ A temporal value (date, time, local datetime, duration) that needs to be formatted.
- `format: str` ➡ The wanted format. The parameter supports values defined under [Python strftime format codes](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).

#### Output:

- `formatted: str` ➡ The temporal value in the specified format.

#### Usage:

To reformat a temporal values, use the following query:

```cypher
CALL temporal.format(duration({minute: 127}), "%H:%M:%S")
YIELD formatted
RETURN formatted;
```

Result:

```plaintext
+-----------------------+
| formatted             |
+-----------------------+
| "02:07:00"            |
+-----------------------+
```
