> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-display-dates-in-different-formats.md).

# How To: Display Dates in Different Formats

Format Salesforce dates into readable US, long, European, or custom date patterns.

Use `format-date` when you want readable output instead of the default database date format.

### Problem

You need to show dates in readable formats rather than the database format (`YYYY-MM-DD`).

### Solution

**US Format (Month/Day/Year):**

```
{{!Opportunity.CloseDate format-date="MM/dd/yyyy"}}
```

**Result:** `01/15/2024`

**Long Format:**

```
{{!Opportunity.CloseDate format-date="MMMM dd, yyyy"}}
```

**Result:** `January 15, 2024`

**European Format:**

```
{{!Opportunity.CloseDate format-date="dd.MM.yyyy"}}
```

**Result:** `15.01.2024`

**With Day of Week:**

```
{{!Opportunity.CloseDate format-date="EEEE, MMMM dd, yyyy"}}
```

**Result:** `Monday, January 15, 2024`

**Just the Month:**

```
{{!Opportunity.CloseDate format-date="MMMM"}}
```

**Result:** `January`

**Just the Year:**

```
{{!Opportunity.CloseDate format-date="yyyy"}}
```

**Result:** `2024`

### Date Pattern Reference

| Pattern | Meaning                  | Example |
| ------- | ------------------------ | ------- |
| `yyyy`  | 4-digit year             | 2024    |
| `yy`    | 2-digit year             | 24      |
| `MMMM`  | Full month name          | January |
| `MMM`   | Short month name         | Jan     |
| `MM`    | Month number (01-12)     | 01      |
| `dd`    | Day with leading zero    | 05      |
| `d`     | Day without leading zero | 5       |
| `EEEE`  | Full day name            | Monday  |
| `EEE`   | Short day name           | Mon     |

### Tips

* Patterns are case sensitive. `MM` means month. `mm` means minutes.
* Month and day names always render in English.
* Create formula fields for other languages when needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sdocs.com/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-display-dates-in-different-formats.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
