---
schema_version: "1"
id: 59b1f65b3ed6486e896baeda0ce3c728b94ce7797b40475cc3d7548e4127333c
title: AMPscript System Time and Date Strings
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/guide/language-basics/mc-ampscript-guide-language-basics-personalization-strings-system.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/guide/mc-ampscript-guide-language-basics-personalization-strings-system.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d5530fb5f983594e4f004f629c0e2637d2c0c8a9dea1fab568e11dd8627225d0
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# 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.

| String           | Description                                  | Example                  |
| ---------------- | -------------------------------------------- | ------------------------ |
| `xtmonth`        | The full name of the month.                  | August                   |
| `xtmonthnumeric` | The month expressed as a number from 1-12.   | 8                        |
| `xtday`          | The day of the month, expressed as a number. | 5                        |
| `xtdayofweek`    | The day of the week.                         | Saturday                 |
| `xtyear`         | The year, expressed in four digits           | 2023                     |
| `xtshortdate`    | The full date in short format.               | 08/05/2023               |
| `xtlongdate`     | The full date in long format.                | Saturday, August 5, 2023 |

## Using Time and Date Strings with AMPscript Functions

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.

```
<p>This email was sent %%=v(xtdayofweek)=%%, %%=FormatDate(xtlongdate, "d MMMM YYYY")=%%.</p>
```

This example outputs the day, month, and year in the specified format:

```
This email was sent Saturday, 5 August 2023.
```

## See Also

- [Personalization Strings Related to the Sender](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/guide/mc-ampscript-guide-language-basics-personalization-strings-sender.md)
- [Personalization Strings Related to the Recipient](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/guide/mc-ampscript-guide-language-basics-personalization-strings-recipient.md)
