Skip to main content
All CollectionsMessaging with Templates
How to add date & time to templates
How to add date & time to templates
Updated over 2 months ago

Magical comes with date & time macros to help you become even more productive. You can embed macros into any of your templates. This article will explore Macros in more detail.

This article will cover

  1. Date & Time macro

  2. Clipboard macro

  3. FAQs on macros

Date & Time Macro

The Date and Time macro helps you quickly insert the current Date & Time within your Template.

Step 1: Click the Calendar icon at the bottom of your Template

Step 2: Select the Date & Time format you would like included in your Template

Step 3: The Template text will look something like this. Hit Save.

Now when you expand your template, the current date in your desired format will expand.

Clipboard Macro

The Clipboard macro will paste the last contents of your clipboard wherever the macro is placed in your Template. For example, if your Template text read "Happy birthday %clip%", and you last copied the name "Rob", then when expanded, then the Template text would read "Happy birthday Rob".

Step 1: Select the Clipboard icon in your template to indicate where you would like it placed

Step 2: The Template text will look like this. Hit save.

FAQs on Macros

What if I want more options on date & time macros?

If you're interested in using custom Date & Time formats add %d(FORMAT) to your snippet, where FORMAT is one of the options described here. For example, you could add %(ddd) if you wanted to display the short form day of the week; if today was Monday, "Mon" would return when you expand your template.

How do I add/subtract dates & time?

To add dates or times, follow the following format: %d(FORMAT)+DURATION or %d(FORMAT)-DURATION. Importantly, this handles changes in AM/PM, months, leap years, and the whole calendar. To view the syntax for describing duration, see this page.

Examples assuming the current date is "Wednesday May 24th, 2023”:

  • “%d(dddd MMMM Do, YYYY)+P3D” adds 3 days from today, and would display “Saturday May 27th, 2023”

  • “%d(dddd MMMM Do, YYYY)+P2W” adds two weeks from today, and would display “Wednesday June 7th, 2023”

Can I add multiple macros to a single template?

Yes. You can add multiple macros to a single template.

Did this answer your question?