AMPscript System Time and Date Strings

You can use the system date and time strings to output or log the date.

For emails and SMS messages, the values of time and date strings are fixed to the date on which the messages were sent. For CloudPages, the values of time and date strings are based on the date on which the page was rendered.

StringDescriptionExample
xtmonthThe full name of the month.August
xtmonthnumericThe month expressed as a number from 1-12.8
xtdayThe day of the month, expressed as a number.5
xtdayofweekThe day of the week.Saturday
xtyearThe year, expressed in four digits2023
xtshortdateThe full date in short format.08/05/2023
xtlongdateThe full date in long format.Saturday, August 5, 2023

You can combine system date strings with AMPscript functions. This example shows how to change the way that the system date is presented using the FormatDate() function.

This example outputs the day, month, and year in the specified format: