---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: formatWithTimeZone (dateFormat, timeZone)
layout: subsection
---

## <a id="section_m3p_myb_5db"></a>Description

Returns a string representation of a date adjusted with the given time zone in the given date format.

## <a id="section_cyq_j1m_zsb"></a>Return Type

`String`

## <a id="section_instanceMethodSyntax"></a>Instance Method Syntax

```
thisDate.formatWithTimeZone(dateFormat, timeZone)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>dateFormat</td><td>A date format string. For valid date formats, see the Java documentation for <code>java.text.SimpleDateFormat</code>.</td></tr><tr><td>timeZone</td><td>A time zone string. For valid time zones, see the <a href="https://www.joda.org/joda-time/timezones.html">Available Time Zones on Joda.org</a>.</td></tr></tbody></table><br/>

<b>Example</b>

`dateWidget.value.formatWithTimeZone('MM/dd/yyyy HH:mm:ss.SSS', 'America/Los_Angeles')`

## <a id="section_dz5_pwg_5db"></a>Namespace Function Syntax

```
date:formatWithTimeZone(date, dateFormat, timeZone)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>date</td><td>A Date object, typically the value of a date or time tag.</td></tr><tr><td>dateFormat</td><td>A date format string. For valid date formats, see the Java documentation for <code>java.text.SimpleDateFormat</code>.</td></tr><tr><td>timeZone</td><td>A time zone string. For valid time zones, see the Java documentation for <code>java.util.TimeZone</code>.</td></tr></tbody></table><br/>

<b>Example</b>

`date:formatWithTimeZone(date:parseDateString('2016-10-31'), 'dd/MM/yyyy', 'America/Los_Angeles')`

Returns `'31/10/2016'`

### Related Information

[formatDateWithTimeZones (date, inputTimeZone, inputDateTimeFormat, outputTimeZone, outputDateTimeFormat)](/wcp_docs/bgs1527623684746.html)

