Using dynamic dates to revolutionise Zendesk macros and business rules

Written by
Jude Kriwald
Zendesk Consultant
September 12, 2023
min read

Table of Contents

View all guides


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

This is some text inside of a div block.

Zendesk macros, triggers and automations are some of the most popular features of Zendesk users around the world. They are powerful time-savers that ensure your customers can get speedy, high-quality responses without agents breaking a sweat. They are a perfect example of features with a high impact yet low barrier to entry.

Experience the Ease & Confidence of NetSuite Customizations with Salto

Get Started with Salto

What if Zendesk was 4x less work?

Request a Demo ≥


That said, sometimes we want to push our macros, triggers or automations further than is immediately obvious. What if, for example, you want to include custom, time-based dynamic text into your macros or triggers that send emails? Almost all of us will have worked on or experienced a Zendesk instance that automatically tells its customers they’ll receive a reply in three working days. While that’s pretty clear, for a truly excellent customer experience, we can go one step further and be specific about that date and time, all without having to lift a finger.

Imagine emailing a support team and receiving these two responses:

Your request ([email subject]) has been received and is being reviewed by our support staff.

To add additional comments, reply to this email.

Whilst this is the default response from a Zendesk account that hasn’t been modified, you can do so much better, and it can all be just as automated as the above.

Hi Julia,

Thank you for your email. I just wanted to let you know that our team has received it safely. We’ll get back to you no later than Thursday by 4 pm.

I hope you have a wonderful day and we look forward to helping you soon.

Kind regards,


[company name]

See how much nicer that is to read? In this series, I’ll show you how to create an auto-response just like this.

Understanding dynamic dates

To write a dynamic date and/or time in Zendesk, we need to use a specific syntax. That syntax is known as Ruby. You may have heard of Ruby as one of the most popular programming languages today. Fret not though, for you do not need to be a programmer to know how to put this to good use. In this article, I’ll share some of the best examples of dynamic dates that you can copy and paste directly into your Zendesk account.

All of the below examples can be copied into macros, triggers, automations and more. You can also copy them directly into Zendesk’s comment editor to test them before saving. 

When you first copy them into a text editor on Zendesk (such as the comment editor or macro editing screen), the string, as these bundles of code are known, will not update to the desired date/time right away. It’s only once you actually submit a ticket, or your trigger/automation fires, that you’ll see that Zendesk has processed your string into a legible date and time.

Tips & tricks from Zendesk masters

Subscribe to our newsletter to learn how to customize Zendesk and keep your agents happy

This is a monthly email with educational content. No spam (we promise).

Dynamic date examples

Try copying and pasting these into the Zendesk comment editor, then submitting the ticket, to see what they look like. Remember that these are just examples, and the output dates will vary depending on what the date is when you try this. As you can tell, I tested these out on June 23rd, 2023, which was a Friday.

Current date

Use case:

This is the most basic building block of all the strings below. It will always display the current date of the UTC time zone (see part 2 of this series for much more on time zones).

{{'now' | date:'%Y-%m-%d'}}


Current date and time

Use case:

The same as above, but when you need to display the current time too.

{{'now' | date:'%Y-%m-%d %H:%M'}}

2023-06-23 12:52

Current date plus 30 days

Use case:

This string is particularly useful for time-limited offers like free trials. You could use it in an automated welcome email to let a customer know on which date their trial will end. The number shown is 30 days, expressed in seconds. Zendesk always computes time calculations in seconds, so you’ll need to convert whatever time you’re working with into seconds.

        {{ 'now' | date: '%s' | plus:2592000| date: '%Y-%m-%d' }}


Current date minus 30 days

Use case:

This is probably not as common, but it’s useful even if it’s just to demonstrate how to subtract a period of time. 

        {{ 'now' | date: '%s' | minus:2592000| date: '%Y-%m-%d' }}


In Part 2, we’ll cover more advanced dynamic dates. Stay tuned for Part 3 too, as I’ll show you how to format the outputted dates into a much friendlier date intended for human consumption!

Written by
Jude Kriwald

Jude Kriwald first learned to administer Zendesk in 2015 and has been helping businesses improve their customer operations as a freelance consultant since 2018. Offline, he can be found making maps, paragliding or exploring remote places.

Written by