---
schema_version: "1"
id: df41f345f9fc1981fbc61432074b1fedfee16d08e2f54d32353128102f632769
title: atBeginningOfMonth
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-dates-functions-atbeginningofmonth.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-dates-functions-atbeginningofmonth
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b934bd1602d389f8ca7cb5cdc8b9fd1d3a6ce0705a7372e3dbed0b49d5dfc20e
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# atBeginningOfMonth

## [](#atbeginningofmonth1)atBeginningOfMonth(dateTime: DateTime): DateTime

入力の ​`Day`​ 値を指定された​_月_​の初日に変更する新しい ​`DateTime`​ 値を返します。​`Time`​ 値も ​`00:00:00`​ に設定します。

入力内の日時は ​`01T00:00:00`​ に変更されます。

_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>dateTime</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>参照する ​<code>DateTime</code>​ 値。</p>
</div></div></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、​`DateTime`​ 入力内の ​`Day`​ 値を指定された月の初日に変更し、​`Time`​ 値を ​`00:00:00`​ に設定します。

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

```DataWeave
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
  "atBeginningOfMonthDateTime": atBeginningOfMonth(|2020-10-06T18:23:20.351-03:00|)
}
```

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

```Json
{
  "atBeginningOfMonthDateTime": "2020-10-01T00:00:00-03:00"
}
```

## [](#atbeginningofmonth2)atBeginningOfMonth(localDateTime: LocalDateTime): LocalDateTime

入力の ​`Day`​ 値と ​`LocalTime`​ 値を指定された​_月_​の開始に変更する新しい ​`LocalDateTime`​ 値を返します。

入力内の日時は ​`01T00:00:00`​ に変更されます。

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

### [](#パラメーター-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>localDateTime</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>参照する ​<code>LocalDateTime</code>​ 値。</p>
</div></div></td>
</tr>
</tbody>
</table>

### [](#例-2)例

次の例では、​`LocalDateTime`​ 入力内の ​`Day`​ 値と ​`LocalTime`​ 値を指定された月の開始に変更します。

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

```DataWeave
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
 "atBeginningOfMonthLocalDateTime": atBeginningOfMonth(|2020-10-06T18:23:20.351|)
}
```

#### [](#出力-2)出力

```Json
{
  "atBeginningOfMonthLocalDateTime": "2020-10-01T00:00:00"
}
```

## [](#atbeginningofmonth3)atBeginningOfMonth(date: Date): Date

入力の ​`Day`​ 値を指定された​_月_​の初日に変更する新しい ​`Date`​ 値を返します。

入力内の日は ​`01`​ に変更されます。

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

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

<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>date</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>参照する ​<code>Date</code>​ 値。</p>
</div></div></td>
</tr>
</tbody>
</table>

### [](#例-3)例

次の例では、​`Date`​ 入力内の ​`Day`​ 値を指定された月の初日に変更します。

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

```DataWeave
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
  atBeginningOfMonthDate: atBeginningOfMonth(|2020-10-06|)
}
```

#### [](#出力-3)出力

```Json
{
  "atBeginningOfMonthDate": "2020-10-01"
}
```