The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

AMPscript Date and Time Functions

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

This section contains information about these AMPscript functions.

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