Inserting the current date or time can be particularly useful for transactional emails or purchase confirmations, where showing the email receipt date is important. In this case, "current" refers to the date and time when the contact receives the email.
To add a live timestamp, place this code into a text block within the drag-and-drop editor:
%%clock format [clock seconds] -format {%B %d, %Y}%%
The part inside the curly braces ({%B %d, %Y}
) controls how the date and time are displayed. You can adjust the formatting by changing the codes inside.
Here are the most popular options you can use to modify how the date and time appear (Capital letters are underscored):
%a
– Abbreviated weekday (e.g., Thu)%A
– Full weekday name (e.g., Thursday)%b
– Abbreviated month (e.g., May)%B
– Full month name (e.g., May)%h
– Another format for abbreviated month (e.g., May)%m
– Numeric month (e.g., 05)%d
– Numeric day of the month (e.g., 24)%D
– Date in MM/DD/YYYY format (e.g., 05/24/2018)%y
– Two-digit year (e.g., 18)%Y
– Four-digit year (e.g., 2018)%H
– Hour (24-hour format, e.g., 10)%M
– Minutes (e.g., 47)%S
– Seconds (e.g., 23)%P
– Lowercase am/pm%p
– Uppercase AM/PM%s
– Shows the number of seconds since midnight, January 1, 1970 (known as the Unix Epoch).
Here are examples of different ways you can display the date and time:
Format Code | Example Output |
---|---|
%%clock format [clock seconds] -format {%B %d, %Y}%% | May 24, 2018 |
%%clock format [clock seconds] -format {%b %d, %y}%% | May 24, 18 |
%%clock format [clock seconds] -format {%D}%% | 05/24/2018 |
%%clock format [clock seconds] -format {%m/%d/%y}%% | 05/24/18 |
%%clock format [clock seconds] -format {%m/%d/%y %H:%M:%S}%% | 05/24/18 12:04:00 |
05/24/2018
will always include a leading zero for single-digit months and days (e.g., May is "05").