OnVoard uses liquid template language by Shopify to generate dynamic content for personalization. Below are some tips for liquid template that you may find handy.

 

Working with Timezone

Most macros used by OnVoard will provide you with variable created_timestamp, which is a unix timestamp. When converted to datetime, it will always be converted to UTC timezone. In some cases, you may want to add some formatting to display time in your timezone.

Say we want it to be shown in Singapore time, which is UTC+8, we can add or subtract the appropriate time difference, and format it accordingly.

# 21 June 2019 at 22:05 (Singapore Time)
{{ created_timestamp | plus: 28800 | date: "%e %B %Y at %H:%M (Singapore Time)" }}

Another example, this time to show current time in your timezone. "now" is a special word that can be used to get current time.

# 21 June 2019 at 22:05 (Singapore Time)
{{ "now" | date: "%s" | plus: 28800 | date: "%e %B %Y at %H:%M (Singapore Time)" }}

See liquid date filter for more reference.