> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/conversion/todate.md).

# toDate

## Description

Converts a date from one timezone to another.

## Input / Parameter

| Name     | Description                                                                  | Input Type | Default | Options | Required |
| -------- | ---------------------------------------------------------------------------- | ---------- | ------- | ------- | -------- |
| value    | The datetime to be modified. Default value is the current date at UTC+00:00. | Text       | -       | -       | No       |
| timezone | The timezone to apply.                                                       | Text       | -       | -       | Yes      |

## Output

| Description                    | Output Type |
| ------------------------------ | ----------- |
| Returns the modified datetime. | Text        |

## Example

In this example, we will convert a string into date using `Asia/Tokyo` as the timezone.

### Step

1. Drag a `button` component into the canvas and open the `Action` tab. Select the `press` event of the button.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-195a758609e6d4fa272b9709813ade73fff64422%2FtoDate-step-1.png?alt=media)
2. Add `Log.write` function and add a subflow on it's value.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-d8741b449a4d94e79ccbca74e05ba596daac2812%2FtoDate-step-2.png?alt=media)
3. Then put `Conversion.toDate` inside it and fill the value as "2024-10-10T12:30:00" and the timezone as "Asia/Tokyo".

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-caf5d17d5c33c648993316c242f76eb1dc4a871d%2FtoDate-step-3.png?alt=media)

### Result

1. The console will return the formatted date from the string. (10/10/2024, 1:16:44 PM)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-7184e6c00a6d911900cca7d5ac31274e270c8157%2FtoDate-result.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/conversion/todate.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
