---
schema_version: "1"
id: 6b78eb89b923e3bc768c95ddb3c7982a1a80a7d1f0afa063ee8228a1d37b7a25
title: daysBetween
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-core-functions-daysbetween.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-core-functions-daysbetween
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 96e53e58b0641f3aada2d34d105e7648a4ba93b15e4f2e47dcf18285bd3e391c
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# daysBetween

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## daysBetween(from: Date, to: Date): Number

Returns the number of days between two dates.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>from</code></p></td><td><p>From date (a <code>Date</code> type).</p></td></tr><tr><td><p><code>to</code></p></td><td><p>To date (a <code>Date</code> type). Note that if the <code>to</code> date is <em>earlier</em> than the <code>from</code> date, the function returns a negative number equal to the number of days between the two dates.</p></td></tr></tbody></table>

### Example

This example returns the number of days between the specified dates.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ days : daysBetween('2016-10-01T23:57:59-03:00', '2017-10-01T23:57:59-03:00') }
```

#### Output

```JSON
{ "days" : 365 }
```
