AMPscript Date and Time Functions

Use the AMPscript Date and Time functions to retrieve, transform, and display times and dates.

This table lists all of the AMPscript functions related to dates and times. The value in the Engagement column indicates whether Marketing Cloud Engagement supports the function. The value in the Next column indicates whether Marketing Cloud Next supports the function.

Function NameDescriptionEngagementNext
DateAdd()Adds a specified time value to a date.✅ Yes✅ Yes
DateDiff()Returns the difference between two dates or times.✅ Yes✅ Yes
DateParse()Returns a DateTime object from a date string.✅ Yes✅ Yes
DatePart()Extracts a date part from a date or timestamp string.✅ Yes✅ Yes
FormatDate()Formats a string as a date value.✅ Yes✅ Yes
GetSendTime()Returns a timestamp for the beginning or end of a send.✅ Yes❌ No
LocalDateToSystemDate()Converts a local datetime string to the system time.✅ Yes❌ No
Now()Returns the current system timestamp.✅ Yes✅ Yes
StringToDate()Converts a date string to a .NET datetime object.✅ Yes✅ Yes
SystemDateToLocalDate()Converts the system time to a local datetime string.✅ Yes❌ No