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

# Différence entre dates

> Calculer la différence entre deux dates

## Présentation

La transformation `diff-dates` calcule la différence entre deux dates.

## Syntaxe

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
diff-dates(<variable 1>, <variable 2>, unit="days")
```

## Paramètres

| Paramètre     | Type   | Requis | Description                                                                                                    |
| ------------- | ------ | ------ | -------------------------------------------------------------------------------------------------------------- |
| `variable 1`  | date   | Oui    | Première date                                                                                                  |
| `variable 2`  | date   | Oui    | Seconde date                                                                                                   |
| `unit`        | string | Non    | Unité de différence : `"milliseconds"`, `"seconds"`, `"minutes"`, `"hours"`, `"days"`, `"months"` ou `"years"` |
| `inputLocale` | string | Non    | Locale utilisée pour analyser les dates d'entrée : `"pt"`, `"nl"`, `"en"`, `"de"`, `"ja"`, `"zh"` ou `"fr"`    |

## Exemples

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
diff-dates(<variable 1>, <variable 2>, unit="days")
diff-dates(<variable 1>, <variable 2>, unit="hours")
diff-dates(<variable 1>, <variable 2>, unit="seconds", inputLocale="fr")
```
