---
schema_version: "1"
id: 494b43200defd2e7c8a4b07891308867f34896292de6f31c0e1ba3da459360d8
title: between
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-periods-functions-between.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-periods-functions-between
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d06b8ab160e42cc722b0214269bfa78596ebf9064fa1950647c00a3bdecf1a1a
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# between

## [](#between1)between(endDateExclusive: Date, startDateInclusive: Date): Period

2 つの Date (日付) 値間の年数、月数、日数で構成される Period (期間) (P) 値を返します。

開始日は含まれますが、終了日は含まれません。 このメソッドの結果は、終了日 (​`endDateExclusive`​) が開始日 (​`startDateInclusive`​) より前の場合、負の期間になる可能性があります。

関数の最初のパラメーターは ​`endDateExclusive`​ であり、2 番目のパラメーターは ​`startDateInclusive`​ です。

_DataWeave バージョン 2.3.0 で導入されました。_​

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

<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>endDateExclusive</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">終了日 (この値を含まない)。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>startDateInclusive</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">開始日 (この値を含む)。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`between`​ の動作を示します。

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

```DataWeave
import * from dw::core::Periods
output application/json
---
{
   a: between(|2010-12-12|,|2010-12-10|),
   b: between(|2011-12-11|,|2010-11-10|),
   c: between(|2020-02-29|,|2020-03-30|)
}
```

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

```Json
{
   "a": "P2D",
   "b": "P1Y1M1D",
   "c": "P-1M-1D"
 }
```