# DATEDIFF

The DATEDIFF function returns the number of days between two input dates. The input dates should be in MM/DD/YYYY format. Node references are also accepted as arguments.

## Syntax

```javascript
datediff(fromDate, toDate)
```

## Arguments

fromDate – The start date of the interval.

toDate – The end date of the interval.

## Return value

Number

## Example

```javascript
datediff('8/16/2023', '8/2/2023')
```

Returns 14.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FE4ppsg4wL3RWFXr0fW4O%2Fimage.png?alt=media&#x26;token=aa991fc1-b1e6-42b3-a5c4-da8ba716a5ab" alt=""><figcaption></figcaption></figure>
