---
schema_version: "1"
id: 35142b4f74d72b80da21e6525931a08a6a1ce3d89b7030e2634152f670a8e112
title: toTimeZone
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-coercions-functions-totimezone.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-coercions-functions-totimezone
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 2db382268b0361e21cae2c681f4ae21be679a41ed0cc8f99511d798f2917d276
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# toTimeZone

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

## toTimeZone(str: String): TimeZone

Transform a `String` value into a `TimeZone` value.

_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>str</code></p></td><td><p>The <code>String</code> value to transform into a <code>TimeZone</code> value.</p></td></tr></tbody></table>

### Example

This example shows how `toTimeZone` behaves with different inputs. It produces output in the
`application/dw` format.

#### Source

```DataWeave
%dw 2.0
import * from dw::util::Coercions
output application/dw
---
{
   toTimeZoneOffset: toTimeZone("-03:00"),
   toTimeZoneAbbreviation: toTimeZone("Z"),
   toTimeZoneName: toTimeZone("America/Argentina/Buenos_Aires")
}
```

#### Output

```DataWeave
{
  toTimeZoneOffset: |-03:00|,
  toTimeZoneAbbreviation: |Z|,
  toTimeZoneName: |America/Argentina/Buenos_Aires|
}
```
