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.
Comments
0 comments
Article is closed for comments.