---
schema_version: "1"
id: bc855c9054f5d07f5c67523d121106ad6374e22cb79d937e6901341349a8ba94
title: between
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-periods-functions-between.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-periods-functions-between
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d3ca556a15fa9c2e1ea8d6f1d200ca92bf4182cc8af85373bb0d77b657408331
description: MuleSoft Documentation Site
release: "2.8"
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"
 }
```