# in\_timezone

Converts a date to a specific timezone. Returns the date formatted as an ISO 8601 string (`YYYY-MM-DDTHH:mm:ss`) in the target timezone.

```liquid
{% assign local_time = "2025-01-15T10:00:00Z" | in_timezone: "America/New_York" %}
{% log local_time %}
```

Output:

```
2025-01-15T05:00:00
```

#### Syntax

```liquid
{{ date | in_timezone: timezone }}
```

| Parameter  | Description                                                                             |
| ---------- | --------------------------------------------------------------------------------------- |
| `date`     | Date to convert — can be a date string, Unix timestamp (seconds), `"now"`, or `"today"` |
| `timezone` | IANA timezone name (e.g. `"America/New_York"`, `"Europe/London"`, `"Asia/Tokyo"`)       |

#### Return Value

Returns a string in `YYYY-MM-DDTHH:mm:ss` format in the specified timezone.

#### Accepted Date Inputs

| Input                    | Description                        |
| ------------------------ | ---------------------------------- |
| `"now"` or `"today"`     | Current date and time              |
| `"2025-01-15T10:00:00Z"` | ISO 8601 date string               |
| `1705312800`             | Unix timestamp in seconds (number) |
| `"1705312800"`           | Unix timestamp in seconds (string) |

#### Examples

**Get current time in a specific timezone:**

```liquid
{% assign local_now = "now" | in_timezone: "Europe/Warsaw" %}
{% log local_now %}
```

**Convert order creation time to shop timezone:**

```liquid
{% assign local_created = order.created_at | in_timezone: shop.timezone %}
{% log "Order created at: " | append: local_created %}
```

**Format a date after timezone conversion:**

```liquid
{% assign local_time = order.created_at | in_timezone: "America/Los_Angeles" %}
{% assign formatted = local_time | date: "%B %d, %Y at %I:%M %p" %}
{% log formatted %}
```

Output:

```
January 15, 2025 at 02:00 AM
```

**Convert Unix timestamp:**

```liquid
{% assign local_time = 1705312800 | in_timezone: "Asia/Tokyo" %}
{% log local_time %}
```

**Use shop's timezone from global variables:**

```liquid
{% assign local_time = order.created_at | in_timezone: shop.timezone %}
{% log local_time %}
```

#### Notes

* Requires a valid IANA timezone name — throws an error if timezone is missing
* The output format is always `YYYY-MM-DDTHH:mm:ss` — use the `date` filter afterwards to reformat
* Chain with `date` for custom formatting: `| in_timezone: "US/Eastern" | date: "%H:%M"`
* See also: `time_add`, `time_subtract`


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datajet-app.com/liquid/filters/in_timezone.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
