---
schema_version: "1"
id: b9eee0a49b11fcf3ed3337fef9ce135a149232dc4a00de2fa3177c6338a2903a
title: toTimeZone
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-coercions-functions-totimezone.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-coercions-functions-totimezone
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 3d385e6d203b25f3b611983825f20cffd47bc3743aa602402bea48ab438487c1
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

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