> For the complete documentation index, see [llms.txt](https://v5docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v5docs.keyfax.biz/reference/expression-reference/date-expressions/asdate.md).

# AsDate

Treats the databox value as a date. Combined with `Format`, it is how a date is written out for a message, a letter or a task.

| Expression                                 | Databox value        | Result                    |
| ------------------------------------------ | -------------------- | ------------------------- |
| `AsDate`                                   | `15-10-2018 08:00pm` | `15/10/2018 20:00:00`     |
| `AsDate Format("ddd dd MMM yyyy - HH:mm")` | `15-10-2018 08:00pm` | `Mon 15 Oct 2018 - 20:00` |

**Format specifiers**

| Specifier  | Gives                       | Example       |
| ---------- | --------------------------- | ------------- |
| `d`        | Day, month and year         | `15/10/2018`  |
| `dd`       | Day of the month            | `15`          |
| `ddd`      | Short day name              | `Mon`         |
| `dddd`     | Full day name               | `Monday`      |
| `D`        | Day, short month, year      | `15 Oct 2018` |
| `m`        | Day and short month         | `15 Oct`      |
| `mm`       | Minutes past the hour       | `00`          |
| `MM`       | Month number                | `10`          |
| `MMM`      | Short month name            | `Oct`         |
| `y`        | Short month and year        | `Oct 2018`    |
| `yy`       | Last two digits of the year | `18`          |
| `yyyy`     | The year                    | `2018`        |
| `HH:mm`    | 24-hour time                | `20:00`       |
| `hh:mm tt` | 12-hour time                | `08:00 PM`    |

Note the case: `mm` is minutes and `MM` is months. Getting those the wrong way round is the most common mistake on this page.

`AsDate` combines with the other date functions: `AsDate BetweenDates(DateAdd(Today, -1, 'yyyy'), Today)` answers whether the date falls within the last year.
