---
schema_version: "1"
id: 5499622fac9353ae4e34865dfb7711757e97ee173dbbb64eccb51a90c7828ec0
title: date
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.4/dw-dates-functions-date.md
canonical_url: https://docs.mulesoft.com/dataweave/2.4/dw-dates-functions-date
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7b8afe506795458426f6ce4cf557fc83f5f4d0829438ad3dbe55a0c90c8894df
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
---
product: DataWeave
version: 2.4
---

# date

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

## date(parts: DateFactory): Date

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

_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>parts</code></p></td><td><div><div><p><code>Number</code> values for <code>year</code>, <code>month</code>, and <code>day</code> fields. The <code>month</code> must be a value between 1 and 12, and the <code>day</code> value must be between 1 and 31. You can specify the name-value pairs in any order, but the output is ordered by default as a Date value, such as <code>2012-10-11</code>. The input fields are parts of a <code>DateFactory</code> type.</p></div></div></td></tr></tbody></table>

### Example

This example shows how to create a value of type `Date`.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
   newDate: date({year: 2012, month: 10, day: 11})
}
```

#### Output

```Json
{
   "newDate": "2012-10-11"
}
```
