By default, date and time placeholders in SweetHawk apps output values in UTC (Coordinated Universal Time). This can be confusing if you’re operating in a different timezone and want your timestamps to reflect your local time.
Thankfully, you can easily adjust the timezone of any datetime placeholder using Liquid markup.
Example: Converting UTC to AEST
Let’s say you’re using the following placeholder in a reminder template:
{{reminder.notify_at}}This will show the datetime in UTC. To display the time in AEST (Australian Eastern Standard Time), simply apply the in_time_zone filter:
{{reminder.notify_at | in_time_zone: 'Australia/Sydney'}}Now, the timestamp will appear in Australia/Sydney time, which automatically accounts for AEST/AEDT (daylight savings).
General Syntax
To change the timezone for any datetime placeholder, use this format:
{{ datetime_value | in_time_zone: 'Region/City' }}Replace 'Region/City' with the timezone you want to display. Some common examples include:
- 'America/New_York' (Eastern Time)
- 'Europe/London' (UK Time)
- 'Asia/Tokyo' (Japan Time)
You can find the full list of supported timezone names here:
🔗 List of tz database time zones
Use the TZ database name (e.g., Australia/Sydney) in your Liquid filter.
Final Tip
Make sure to test your placeholder with the new timezone setting to confirm it’s displaying the expected local time.