---
schema_version: "1"
id: 24d715f3df939abb012fa964c44a34bc2b880ed4e22626b85a5d8e3c40360022
title: atBeginningOfWeek
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-dates-functions-atbeginningofweek.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-dates-functions-atbeginningofweek
source_site: docs.mulesoft.com
content_type: documentation
content_hash: fe6b802ccd8bf4ed86142fcd0e49c9fd37a77af3d14bd5b423c364c3bd3973cc
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# atBeginningOfWeek

## [](#atbeginningofweek1)atBeginningOfWeek(dateTime: DateTime): DateTime

入力の ​`Day`​ 値と ​`Time`​ 値を指定された​_週_​の初日の開始に変更する新しい ​`DateTime`​ 値を返します。

この関数では、日曜日を週の初日として扱います。

_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`​ 値 (​`06T18:23:20.351`​) を指定された​_週_​の初日の開始 (​`04T00:00:00`​) に変更します。

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

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

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

```Json
{
  "atBeginningOfWeekDateTime": "2020-10-04T00:00:00-03:00"
}
```

## [](#atbeginningofweek2)atBeginningOfWeek(localDateTime: LocalDateTime): LocalDateTime

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

この関数では、日曜日を週の初日として扱います。

_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`​ 値と ​`Time`​ 値 (​`06T18:23:20.351`​) を指定された​_週_​の初日の開始 (​`04T00:00:00`​) に変更します。

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

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

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

```Json
{
  "atBeginningOfWeekLocalDateTime": "2020-10-04T00:00:00"
}
```

## [](#atbeginningofweek3)atBeginningOfWeek(date: Date): Date

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

この関数では、日曜日を週の初日として扱います。

_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`​ 値 (​`06`​) を ​`2020-10-06`​ (木曜日) が含まれる週の初日、つまり ​`2020-10-04`​ (日曜日) に変更します。 `Day`​ 値は ​`06`​ から ​`04`​ に変更されます。

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

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

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

```Json
{
  "atBeginningOfWeekDate": "2020-10-04"
}
```