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

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