---
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: formatDateWithTimeZones (date, inputTimeZone, inputDateTimeFormat, outputTimeZone, outputDateTimeFormat)
layout: subsection
---

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

Returns a string representation of a date adjusted with the given time zone. The returned date uses the specified output date and time zone format.

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

`String`

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

```
date:formatDateWithTimeZones(date, inputTimeZone, inputDateTimeFormat, outputTimeZone, outputDateTimeFormat)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>date</td><td>A Date object to adjust and format. The Date object is typically the value of a date or time tag.</td></tr><tr><td>inputTimeZone</td><td>A time zone string for the input date. 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><tr><td>inputDateTimeFormat</td><td>A date and time format string for the converted date. For valid date and time formats, see the Java documentation for <code>java.text.SimpleDateFormat</code>.</td></tr><tr><td>outputTimeZone</td><td>A time zone string for the output date. 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><tr><td>outputDateTimeFormat</td><td>A date and time format string for the converted date. For valid date and time formats, see the Java documentation for <code>java.text.SimpleDateFormat</code>.</td></tr></tbody></table><br/>

<b>Example</b>

`date:formatDateWithTimeZones('2017-08-18 03:00:00.000Z', 'Pacific/Honolulu', 'yyyy-MM-dd HH:mm:ss.SSS', 'Pacific/Honolulu', 'yyyy-MM-dd HH:mm:ss.SSSXXX')`

Returns `'2017-08-18 03:00:00.000-10:00'`

### Related Information

[formatWithTimeZone (dateFormat, timeZone)](/wcp_docs/msn1526018546174.html)

