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

# Time range (`timerange`)

> **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.

Interval between two points of time, like 8:00-21:00 or 8:00AM-1:00PM.

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

## Detection

Regular expression (Python `re`):

```
^(?:[01]?\d|2[0-4]):[0-5]\d ?(?:[AaPp][Mm])? ?[-–] ?(?:[01]?\d|2[0-4]):[0-5]\d ?(?:[AaPp][Mm])?$
```

## Examples

- `08:00-22:00` — Opening hours
- `8:00AM-1:00PM` — Opening hours with a 12-hour clock
- `9:00 - 15:00` — With spaces around the dash
- `08:00` (invalid example) — A single time

## Metacrafter rules

1 rules: 0 match the field name, 1 match values.

- `timerangebypat` (data, `ext/ext_datetime.yaml`)

## Supported by tools

- `metacrafter`
- `metacrafterpro`

## Quality

Score 70/100. Missing: source link, mapping (Wikidata, Schema.org, ...), translation.

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