Formatting dates with liquid syntax
Overview
Ortto allows you to use Liquid template language in your email, SMS, and push notifications. This makes it possible to display dynamic dates and times, calculate future or past dates, and format timestamps based on your messaging needs.
By combining merge tags with Liquid date filters, you can create messages that automatically update such as showing today’s date, calculating relative timeframes, or formatting dates for different timezones.
TIP: You can use the `assign ` operator to create a variable to modify dates or timeframe values.
Learn more about personalizing campaign content with Liquid.
Description | Format | Example Output | Notes |
|---|---|---|---|
Change timezone |
|
| Sets a timezone offset in seconds (UTC-5 = 5 × 3600). Converts |
Current year |
|
| Returns the current year in four-digit format. |
Last month |
|
| Calculates the previous month by moving to the first day of the current month, subtracting one second, and formatting the result. |
Time in timezone |
|
| Converts a date/time value to the specified timezone and format. |
Today’s date |
|
| Formats today’s date using a custom date string. |
Tomorrow |
|
| Converts today to seconds, adds one day (86,400 seconds), and formats the result. |
Two weeks from today |
|
| Adds 14 days in seconds to today’s date, then formats the result. Variables must start with |
Current week range |
|
| Calculates the current week from Sunday to Saturday by converting dates to seconds and adding or subtracting day offsets. Outputs a formatted date range. |