The DateTime
value to reference.
atBeginningOfMonth
atBeginningOfMonth(dateTime: DateTime): DateTime
Returns a new DateTime
value that changes the Day
value from the
input to the first day of the specified month. It also sets the Time
value to 00:00:00
.
The day and time in the input changes to 01T00:00:00
.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
Example
This example changes the Day
value within the DateTime
input to the
first day of the specified month and sets the Time
value to 00:00:00
.
Source
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
"atBeginningOfMonthDateTime": atBeginningOfMonth(|2020-10-06T18:23:20.351-03:00|)
}
DataWeave
Output
{
"atBeginningOfMonthDateTime": "2020-10-01T00:00:00-03:00"
}
Json
atBeginningOfMonth(localDateTime: LocalDateTime): LocalDateTime
Returns a new LocalDateTime
value that changes the Day
and LocalTime
values from the input to the beginning of the specified month.
The day and time in the input changes to 01T00:00:00
.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
The |
Example
This example changes the Day
and LocalTime
values within the LocalDateTime
input to the beginning of the specified month.
Source
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
"atBeginningOfMonthLocalDateTime": atBeginningOfMonth(|2020-10-06T18:23:20.351|)
}
DataWeave
Output
{
"atBeginningOfMonthLocalDateTime": "2020-10-01T00:00:00"
}
Json
atBeginningOfMonth(date: Date): Date
Returns a new Date
value that changes the Day
value from the
input to the first day of the specified month.
The day in the input changes to 01
.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
The |
Example
This example changes the Day
value within the Date
input to the first day of the specified month.
Source
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
atBeginningOfMonthDate: atBeginningOfMonth(|2020-10-06|)
}
DataWeave
Output
{
"atBeginningOfMonthDate": "2020-10-01"
}
Json