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

# 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"
}
```
