Contact Us 1-800-596-4880

Dates (dw::core::Dates)

This module contains functions for creating and manipulating dates.

To use this module, you must import it to your DataWeave code, for example, by adding the line import * from dw::core::Dates to the header of your DataWeave script.

Introduced in DataWeave version 2.4.0.

Functions

Name Description

atBeginningOfDay

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

atBeginningOfHour

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

atBeginningOfMonth

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.

atBeginningOfWeek

Returns a new DateTime value that changes the Day and Time values from the input to the beginning of the first day of the specified week.

atBeginningOfYear

Takes a DateTime value as input and returns a DateTime value for the first day of the year specified in the input. It also sets the Time value to 00:00:00.

date

Creates a Date value from values specified for year, month, and day fields.

dateTime

Creates a DateTime value from values specified for year, month, day, hour, minutes, seconds, and timezone fields.

localDateTime

Creates a LocalDateTime value from values specified for year, month, day, hour, minutes, and seconds fields.

localTime

Creates a LocalTime value from values specified for hour, minutes, and seconds fields.

time

Creates a Time value from values specified for hour, minutes, seconds, and timezone fields.

today

Returns the date for today as a Date type.

tomorrow

Returns the date for tomorrow as a Date type.

yesterday

Returns the date for yesterday as a Date type.

Types