---
schema_version: "1"
id: 3ef3ac586a51f3860b7ca2e64aceb6a823377c7ef5192979bbd987a9069827ea
title: days
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-periods-functions-days.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-periods-functions-days
source_site: docs.mulesoft.com
content_type: documentation
content_hash: adebfa977707283f307dd03d433b28a63375feedfc33a5208d55ebca93458052
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# days

## [](#days1)days(nDays: Number): Period

指定された日数から Period (期間) 値を作成します。

この関数では、​`period`​ 関数を整数の入力に、​`duration`​ 関数を小数の入力に適用します。

_DataWeave バージョン 2.4.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>nDays</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">整数または小数としての時間数。
          正または負の数値が有効です。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`days`​ の動作を示します。DateTime (日時) 値に対して時間数を加算および減算します。また、小数値 ​`4.555`​ を Period (期間) 形式の時間数、分数、秒数 (​`PT109H19M12S`​) に、整数 ​`4`​ を Period (期間) 形式の日数 (​`P4D`​) にも変換します。

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

```DataWeave
%dw 2.0
import * from dw::core::Periods
output application/json
---
{
   tomorrow: |2020-10-05T20:22:34.385Z| + days(1),
   yesterday: |2020-10-05T20:22:34.385Z| - days(1),
   decimalDaysPlusQuarter:  |2020-10-05T00:00:00.000Z| + days(0.25),
   decimalDaysPlusHalf:  |2020-10-05T00:00:00.000Z| + days(0.5),
   decimalDaysPlusThreeQuarters:  |2020-10-05T00:00:00.000Z| + days(0.75),
   decimalInputAsPeriod : days(4.555),
   fourDayPeriod: days(4),
   negativeValue: days(-1)
}
```

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

```Json
{
   "tomorrow": "2020-10-06T20:22:34.385Z",
   "yesterday": "2020-10-04T20:22:34.385Z",
   "decimalDaysPlusQuarter": "2020-10-05T06:00:00Z",
   "decimalDaysPlusHalf": "2020-10-05T12:00:00Z",
   "decimalDaysPlusThreeQuarters": "2020-10-05T18:00:00Z",
   "decimalInputAsPeriod": "PT109H19M12S",
   "fourDayPeriod": "P4D",
   "negativeValue": "P-1D"
}
```