---
title: "DATEDIFF"
url: "https://help.formsfly.com/en/article/datediff"
language: "en"
last_updated: "2024-11-01T15:41:23.970Z"
---

# DATEDIFF

Calculates the total number of minutes, hours, days, months, or years between two date/times.

* * *

### Syntax

`**DATEDIFF(startdate**, enddate, unit**)**`

### Example

```plaintext
DATEDIFF('2024-04-19', '2024-04-27', 'DD')
```

returns: `8` (days)

### Notes

Unit specifiers are:  
YY - whole years  
MM - whole months  
DD - whole days  
HH - whole hours  
MI - whole minutes  
SS - whole seconds

### Related 

[DATEADD](https://help.formsfly.com/en/article/dateadd)
