Insert current date and time
At times you may need to merge in the current date into content files. This may be due to transactional or purchase interactions with your contacts. In this context, "current" refers to date/time the email is received.
There are several different ways to format this merge tag based on how you want the date and time to show. All are outlined below:
How-To
To add these timestamps, insert this code into a text field in the Drag and Drop editor:
%%clock format [clock seconds] -format {%B %d, %Y}%%
The bold section will determine how the date is displayed. Here are some common ways to edit that section so that the date appears in the desired format:
-
For dates: (capital letters are underlined)
%a - Day of the week abbreviation (Thu)
%A - Day of the week speed out (Thursday)
%b - spells out the month (May)
%B - also spells out the month (May)
%h - also spells out the month (May)
%m - write the month in numbers (05)
%d - write the day in numbers (24)
%D - writes the current date in MM/DD/YYYY format (05/24/2018)
%y - write the last two numbers of the year (18)
%Y - writes the full year (2018)
-
For timestamps: (capital letters are underlined)
%H - returns the hour (10)
%M - writes the minute (47)
%S - returns the second (23)
%P - displays am/pm
%p - displays AM/PM
-
Examples of date formats:
%%clock format [clock seconds] -format {%B %d, %Y}%% shows May 24, 2018
%%clock format [clock seconds] -format {%b %d, %y}%% shows May 24, 18
%%clock format [clock seconds] -format {%D}%% shows 05/24/2018
%%clock format [clock seconds] -format {%m/%d/%y}%% shows 05/24/18
%%clock format [clock seconds] -format {%m/%d/%y %H:%M:%S}%% shows 05/24/18 12:04:00
Fun Fact
%s - returns the number of seconds since midnight of 1/1/1970 (called the Unix Epoch)
Keep in mind:
Where %%clock format [clock seconds] -format {%m/%d/%Y}%% would create 05/24/2018, there is no current way to make 5/24/2018 where the leading zero has been stripped for months January-September and days of the month prior to the tenth.
Related Articles
Using Code Blocks to Insert Custom HTML
Code blocks allow you to insert custom HTML code into your email designs, giving you greater flexibility for custom content, real-time personalization, and third-party integrations. This feature is ideal for marketers who need more control over ...
Text editor
Our email designer includes a simple text editor that you can use to further format text. This article includes how-to and FAQ regarding the text editor. Paste Text While we offer the ability to paste content from an external source and retain text ...
How do I use a repeater group to merge order data where multiple records exist?
You may have customers who need to receive emails that display multiple line items in an order. You can use the Repeater Group function to accomplish the insert of multiple rows of data in our drag-and-drop email designer. Once the Repeater Group is ...
How do I merge a Personalized URL (PURL) into my email?
What is a PURL? A PURL is a unique URL designed to be associated with a specific individual or recipient. PURLs are typically used in email to enhance personalization, track unique recipient engagement and responses. Marketers use PURLs for many ...
Text rendering & paste text
Understanding Text Rendering and Pasting Options in the Email Editor When creating content in Delivra’s drag-and-drop email editor, you can copy and paste text from various sources. However, not all formatting is preserved perfectly, and some pasted ...