---
schema_version: "1"
id: aba293deb2f6a8201388aea08ac80e3b68ccbd162abb0dc70f7c05397d9ab409
title: atBeginningOfDay
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-dates-functions-atbeginningofday.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-dates-functions-atbeginningofday
source_site: docs.mulesoft.com
content_type: documentation
content_hash: fcd2f1db13945105ce732be12f3e20c1e4fa86d921149151fe55daa0e9a36a82
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# atBeginningOfDay

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## atBeginningOfDay(dateTime: DateTime): DateTime

Returns a new `DateTime` value that changes the `Time` value in the input to the beginning of the
specified _day_.

The hours, minutes, and seconds in the input change to `00:00:00`.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>dateTime</code></p></td><td><div><div><p>The <code>DateTime</code> value to reference.</p></div></div></td></tr></tbody></table>

### Example

This example changes the `Time` value within the `DateTime` input to the beginning of the specified
day.

#### Source

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

#### Output

```Json
{
  "atBeginningOfDayDateTime": "2020-10-06T00:00:00-03:00"
}
```

## atBeginningOfDay(localDateTime: LocalDateTime): LocalDateTime

Returns a new `LocalDateTime` value that changes the `Time` value within the input to the start of
the specified _day_.

The hours, minutes, and seconds in the input change to `00:00:00`.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>localDateTime</code></p></td><td><div><div><p>The <code>LocalDateTime</code> value to reference.</p></div></div></td></tr></tbody></table>

### Example

This example changes the `Time` value within the `LocalDateTime` input to the beginning of the
specified day.

#### Source

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

#### Output

```Json
{
  "atBeginningOfDayLocalDateTime": "2020-10-06T00:00:00"
}
```
