---
schema_version: "1"
id: e1431184a3ff648ba0646d7cfb1668db6d288c0083992ac674198ec2ad69e494
title: daysBetween
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-core-functions-daysbetween.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-core-functions-daysbetween
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c1b1cec6e57c6ecd6986699f5f2d6d21e39f6a95d35bf0c04abdf35a8e43b1b3
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# daysBetween

## [](#daysbetween1)daysBetween(from: Date, to: Date): Number

2 つの日付間の日数を返します。

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>from</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">開始日 (​<code>Date</code>​ (日付) 型)。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>to</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">終了日 (​<code>Date</code>​ (日付) 型)。​<code>to</code>​ の日付が ​<code>from</code>​ の日付よりも​<em>前</em>​の場合、この 2 つの日付間の日数に等しい負数が返されます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、指定された日付間の日数を返します。

#### [](#ソース)ソース

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

#### [](#出力)出力

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