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.

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

Output:

2025-01-15T05:00:00

Syntax

{{ 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:

Convert order creation time to shop timezone:

Format a date after timezone conversion:

Output:

Convert Unix timestamp:

Use shop's timezone from global variables:

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

Last updated