---
id: "date_ymd_compact"
kind: "pattern"
status: "draft"
is_pii: false
categories: ["datetime"]
langs: ["common"]
quality: 100
url: "http://registry.apicrafter.io/datatype/date_ymd_compact"
---

# Date as YYYYMMDD (`date_ymd_compact`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Calendar date written as eight digits without separators: four-digit year, two-digit month and two-digit day, for example 20241225. This is the basic format of ISO 8601, common in file names, logs and database exports. A column of such values is easy to take for integers.

- Pattern of: `date`
- Personal data (PII): no
- Categories: Date and time (datetime)
- Countries: global
- Languages: Common to most languages (common)

## Detection

Regular expression (Python `re`):

```
^\d{4}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])$
```

## Examples

- `20241225` — 25 December 2024
- `20220505` — 5 May 2022
- `25122024` (invalid example)
- `2024-12-25` (invalid example)

## Mappings

- qddate: `dt:date:date_6`

## Supported by tools

- `qddate`

## Translations

- ru: Дата в формате ГГГГММДД: Календарная дата из восьми цифр без разделителей: год, месяц и день, например 20241225. Это базовый формат ISO 8601.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates>
- other: <https://github.com/ivbeg/qddate/blob/v1.1.0/qddate/patterns/base.py>

## Quality

Score 100/100.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/date_ymd_compact.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/datetime/date_ymd_compact.yaml>
