# Date Parser (/placeholders/parsers/date)



## Usage [#usage]

To use the parser, insert the following syntax in your text:

`{date(format):timestamp}`

## Format Patterns [#format-patterns]

### Date Patterns [#date-patterns]

* `DD` - Day of month (01-31)
* `MM` - Month (01-12)
* `YYYY` - Full year (e.g., 2025)
* `YY` - Short year (e.g., 25)

### Time Patterns [#time-patterns]

* `HH24` - Hours in 24-hour format (00-23)
* `HH` - Hours in 12-hour format (01-12)
* `MI` - Minutes (00-59)
* `SS` - Seconds (00-59)
* `AM/PM` - AM/PM indicator
* `A` - AM/PM indicator (short form)

### Special Formats [#special-formats]

* `unix` - Returns Unix timestamp (milliseconds since epoch)

## Examples [#examples]

### Date Only [#date-only]

* `{date(DD/MM/YYYY):1735772400}` → `01/02/2025`
* `{date(MM/DD/YY):1735772400}` → `02/01/25`
* `{date(YYYY-MM-DD):1735772400}` → `2025-02-01`

### Date and Time [#date-and-time]

* `{date(DD/MM/YYYY HH:MI:SS):1735772400}` → `01/02/2025 14:30:45`
* `{date(MM/DD/YY HH:MI AM/PM):1735772400}` → `02/01/25 02:30 PM`
* `{date(YYYY-MM-DD HH24:MI):1735772400}` → `2025-02-01 14:30`

### Time Only [#time-only]

* `{date(HH:MI:SS):1735772400}` → `02:30:45`
* `{date(HH24:MI):1735772400}` → `14:30`
* `{date(HH:MI A):1735772400}` → `02:30 PM`

### Unix Timestamp [#unix-timestamp]

* `{date(unix):1735772400}` → `1735772400000`

## Variable Support [#variable-support]

You can use variables as timestamp sources:

* `{date(DD-MM-YYYY HH:MI):{member.createdAt}}` → Formats member creation date with time
* `{date(DD/MM/YY HH:MI AM/PM):{message.createdAt}}` → Formats message creation date with time

Note: Timestamps can be in Unix format (seconds since epoch) or any valid date string.
