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

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