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

# time

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

## time(parts: TimeFactory): Time

Creates a `Time` value from values specified for `hour`, `minutes`, `seconds`, and `timezone`
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>hour</code>, <code>minutes</code>, and <code>seconds</code> fields, and a <code>TimeZone</code> value for the <code>timezone</code> field. Valid values are 0 through 23 for the <code>hour</code>, 0 through 59 for <code>minutes</code>, and 0 through 59 (including decimals, such as 59.99) for <code>seconds</code> fields. The <code>timezone</code> must be a valid <code>TimeZone</code> value, such as <code>|-03:00|</code> You can specify the name-value pairs in any order, but the output is ordered as a default <code>Time</code> value, such as <code>10:10:10-03:00</code>. The input fields are parts of a <code>TimeFactory</code> type.</p></div></div></td></tr></tbody></table>

### Example

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

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
  newTime: time({ hour: 12, minutes: 30, seconds: 40 , timeZone: |-03:00| })
}
```

#### Output

```Json
{
   "newTime": "12:30:40-03:00"
}
```
