# Timezone Converter Handler

This  handler serves two purposes:&#x20;

1. Converts Date & Time (object/string) from one time zone to another timezone.&#x20;
2. Generates a timestamp for a given Date & Time (object/string).

The three options available in this Handler are explained in detail below:

## 1. Timezone Converter

The Timezone Converter converts a date-time input in a particular timezone to any selected timezone. The following tables list down the steps to configure the Timezone Converter Handler for two types of Output:  <br>

| **Output** | **Datetime Object Output**                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input      | <p><strong>(i) For String Input:</strong></p><p>Select String under the “Enter Date Time” field and give your input.</p><p>Enter Input Date Format for String Input (Refer to the table below).</p><p>Choose From Timezone and To Timezone from the drop-down list.</p><p><strong>(ii) For date-time input:</strong></p><p>Select Non-String under the “Enter Date Time” field and give your input.</p><p>Choose From Timezone and To Timezone from the drop-down list.</p> |

| Output | **2. String Output**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Input  | <p><strong>(i) For String Input:</strong></p><p>Select String under the “Enter Date Time” field and give your input.</p><p>Enter Input Date Format for String Input by referring to the table below.</p><p>Enter Output Date Format for String Output by referring to the table below.</p><p>Choose From Timezone and To Timezone from the drop-down list.</p><p><strong>(ii) For date-time input:</strong></p><p>Select Non-String under the “Enter Date Time” field and give your input.</p><p>Choose From Timezone and To Timezone from the drop-down list.</p> |

## 2. Timestamp Generator

Generate timestamps from a date inputted previously (MM/DD/YYYY) to the entered Date and Time.&#x20;

**(i) For String Input**

* Select String under the “Enter Date Time” field and give your input
* Enter Input Date Format for String Input by referring to the table below
* Choose the input time zone from the drop-down in the “From timezone” field.

**(ii) For date-time input:**

* Select Non-String  under the “Enter Date Time” field and give your input.
* Choose the input time zone from the drop-down in the “From timezone” field.
* Consider this date for example, Saturday, 27 January 2018, 10:30:00.012345 AM +0530

The following formats are supporte&#x64;**:**

| Format | Value    | Description                                |
| ------ | -------- | ------------------------------------------ |
| %d     | 27       | numerical representation of day            |
| %a     | Sat      | short alphabetical representation of day   |
| %A     | Saturday | alphabetical representation of day         |
| %m     | 01       | numerical representation of month          |
| %b     | Jan      | short alphabetical representation of month |
| %B     | January  | alphabetical representation of month       |
| %y     | 18       | short representation of year               |
| %Y     | 2018     | numerical representation of year           |
| %H     | 10       | hour                                       |
| %M     | 30       | minute                                     |
| %f     | 012345   | microseconds                               |
| %p     | AM       | meridiem                                   |
| %z     | +0530    | timezone offset                            |

**Examples for reference**

| Input                           | Format                   |
| ------------------------------- | ------------------------ |
| 2021-05-27 01:30:00 PM          | %Y-%m-%d %H:%M:%S %p     |
| 2021-05-12T09:46:47-0400        | %Y-%m-%dT%H:%M:%S%z      |
| Sat, 27 Jan 2018 17:16:55 +0000 | %a, %d %b %Y %H:%M:%S %z |
| 2018-01-27T13:34:25.518993+0530 | %Y-%m-%dT%H:%M:%S.%f%z   |

## Modifier: Datetime to Timestamp Modifier

This Modifier is used to provide the timestamp starting from \<MM/DD/YYYY> to a given Date & Time input.&#x20;

* Give the input as a string&#x20;
* In the Parameters field, pass the string format using the table&#x20;
* Provide the timezone of the user input

The supported timezone parameters are listed [here: Supported Timezones](https://docs.dckapintegrator.com/developers/flows/supported-timezones)<br>
