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

# localTime

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

## localTime(parts: LocalTimeFactory): LocalTime

Creates a `LocalTime` value from values specified for `hour`, `minutes`, and `seconds` 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. 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. You can specify the name-value pairs in any order, but the output is ordered as a default <code>LocalTime</code> value, such as <code>10:10:10</code>. The input fields are parts of a <code>LocalDateTimeFactory</code> type.</p></div></div></td></tr></tbody></table>

### Example

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

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
  newLocalTime: localTime({ hour: 12, minutes: 30, seconds: 40})
}
```

#### Output

```Json
{
   "newLocalTime": "12:30:40"
}
```
