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

# Date and time (`datetime`)

Date and time of day. The regexp covers the ISO 8601 extended form YYYY-MM-DDThh:mm[:ss[.fff]] with an optional time zone (Z or an offset), and the RFC 3339 variant with a space instead of T. Some data sets store plain dates as timestamps at midnight local time, for example 2021-05-24T21:00:00.000Z for 25 May 2021 in Moscow.

- 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])[T ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:[.,]\d+)?)?(?:Z|[+-](?:[01]\d|2[0-3])(?::?[0-5]\d)?)?$
```

## Examples

- `2024-08-30T12:00:00.000Z` — UTC timestamp with milliseconds
- `2018-10-10T12:58:52Z`
- `2024-11-29 12:00:00` — Space separator, as allowed by RFC 3339
- `2019-07-19T09:00:00+03:00` — Local time with an offset
- `2024-08-30` (invalid example) — A date without a time is the datatype date

## Mappings

- autotype: `date-R`, `date-chinese2`, `date-f`, `date-g`, `date-german`, `date-mixed`, `date-o`, `date-s`, `date-spanish`, `date-u`, `date5`, `date6`, `date7`, `date8`, `date9`
- d3m: `http://schema.org/DateTime`

## Metacrafter rules

6 rules: 5 match the field name, 1 match values.

- `datetimeknown` (field, `common/dateandtime.yaml`)
- `dedatetimename` (field, `de/de_datetime.yaml`)
- `esdatetimename` (field, `es/es_datetime.yaml`)
- `frdatetimename` (field, `fr/fr_datetime.yaml`)
- `nldatetimepattern` (data, `nl/nl_datetime.yaml`)
- `rusdatetimename` (field, `ru/ru_datetime.yaml`)

## Supported by tools

- `alteryxdesignercloud`
- `auctus`
- `autotype`
- `awscomprehend`
- `collibra`
- `csvdetective`
- `dataiku`
- `dataprep`
- `dataprofiler`
- `googledatastudio`
- `metabase`
- `metacrafter`
- `metacrafterpro`
- `talend`
- `woodwork`

## Translations

- ru: Дата и время: Дата и время суток. Регулярное выражение описывает форму ISO 8601 ГГГГ-ММ-ДДTчч:мм[:сс[.fff]] с необязательным часовым поясом (Z или смещение) и вариант RFC 3339 с пробелом вместо T.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Date_and_time_notation>
- wikipedia: <https://en.wikipedia.org/wiki/ISO_8601>
- schema.org: <https://schema.org/DateTime>

## Quality

Score 100/100.

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