You can include date and time personalization in your emails. Date personalization with time references assumes that you entered time-related information in GMT.
Locations to personalize and valid formats
You can manually enter in date personalization fields and redefine the date format in the following areas:
- Email body
- Dynamic content blocks with personalization inside dynamic content
- Email body that contains external content
- Relational table personalization (RT and database fields)
- SMS message body
- Email header fields
- In email settings
Date and time fields that can be used for personalization include:
- Mailing_send_date_iso
- This field does not allow for any formatting and that it displays the date as: yyyymmdd.
-
Mailing_send_date
- The personalization tag %%MAILING_SEND_DATE%% can only be formatted to display the date of the send in different ways. Therefore you should only use format strings around Day, Month and Year. If you add any of the options for time, then the only time stamp that will be displayed is midnight (12 am, 00:00:00 etc.) We recommend avoiding the time stamp parameters with Mailing_send_date
- Date
- Timestamp
- Numeric
- System Date
- Mailing_send_date
- Segment/send hour
Valid values for month are (case-sensitive):
- MMMM (for example, January)
- MMM (for example, Jan)
- M (for example, 1)
Valid values for day are (case-sensitive):
- dd (for example, 02)
- d (for example, 2)
Valid values for year are (case-sensitive):
- yyyy (for example, 1999)
- yy (for example, 99)
Examples:
- 2021-02-28 HH:mm:ss (hour in a day 0 - 23)
- 2021-02-28 hh:mm a (hour in am/pm)
- 02-28-2021 HH:mm
- 02-28-2021 HH:mm zzz (for example, GMT)
- 02-28-2021 HH:mm zzzz (for example, Greenwich Mean Time)
- 2021/07/24 12:00:00 AM
- Jan 24, 2021 14:00
- January 24, 2021 13:00:00
Valid numeric values - supported characters are as follows:
- 0 = A digit- always displayed
- # = A digit, leading zeros are omitted
- . = marks a decimal separator
- , = marks a grouping separator (for example, thousand separator)
- #,###.00 (for example, 1,000,000.63)
Show the dd/MMM/YYYY date format in an email
In the following example, the following two fields are in the database:
-
- A date field that is called Birthday. In this example, the field contains the value "10/10/1980".
- A text field that is called DateFormatString. This field defines the format of ANY date field.
- Click Data > Contact lists.
- Open the contact's Edit Contact page.
- In the Date Format String field, type
"dd/MMM/YYYY"
. - Save the Edit Contact page.
- In the email body, type
%%format(Birthday, DateFormatString)%%
. - Save the email.
The two fields, Birthday and DateFormatString, are combined to show the birthday date as defined in the DateFormatString field: 10Oct1980
.
Tip: The following options do not work in tandem with language or locale. Instead, you can create dynamic content to use this feature with a language or country data field.
Show the yyyy-MMM-dd format in an email
Use the following option when you want to display a particular date format for an existing date database field in an email for all contacts who receive the email. To show the date format as yyyy-MMM-dd, do the following steps:
- Identify the date field, for example, "Birthday".
- In the email body, type this format:
%%format([enter date field name],"yyyy-MMM-dd")%%
- Save the email.
For example, the Birthday field from your database reads as 10/10/1980. You can change the format to:
%%format(Birthday, "yyyy-MMM-dd")%%
Now, all birthday dates shown in the email are in the yyyy-MMM-dd
format.
Use this option when you want to display a certain format for a specific contact. For example, you might want to show someone's birthday specific to the country they are living in, instead of how their birthday was entered into the Birthday field in the database.
Formatting examples
The following examples show how to add formatting to the email body by using the following format structure:
%%format([enter date field name],"[enter the combination of year, date, and month]")%%
%%format([enter date field name],"yyyy")%%
Example:
%%format(mailing_send_date,"yyyy")%%
%%format([enter date field name]_ISO)%%
Use one of the following formats:
copyright%%format([enter date field name],"yyyy")%%
©%%format([enter date field name],"yyyy")%%
%%format(mailing_send_date,"dd-MM-yyyy")%%
Dynamically add a send date
You can dynamically add a send date to the email body by using the %%MAILING_SEND_DATE%%
personalization tag. You can either manually type in the tag or select it from the Insert Personalization menu in the content builder.