24-Hour Time (HH:MM)
datetime.time.hm_24hHours and minutes only, no seconds. Common in schedules, timetables, and user-facing applications.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As TIME |
|---|---|
| 10:30 | 10:30:00 |
| 23:59 | 23:59:00 |
| 00:00 | 00:00:00 |
- %H
- hour, 24-hour clock
- %M
- minutes
Shape
^\d{2}:\d{2}$| Value | Length | Shape |
|---|---|---|
| 10:30 | 5 | matches |
| 23:59 | 5 | matches |
| 00:00 | 5 | matches |
| 10:3 | 4 | rejected: one character short |
Background
Origin
On the 24-hour clock, a time of day is written in the form hh:mm, for example 01:23.[1] The colon is the most commonly used separator between hours, minutes and seconds on the 24-hour clock.[1] On the 24-hour clock, a leading zero is added for numbers under 10, but it is optional for the hours.[1]
The first edition of the ISO 8601 standard was published as ISO 8601:1988 in June 1988.[2] ISO 8601 lets the seconds be omitted for brevity at the cost of precision, giving T[hh]:[mm] in the extended format.[2] RFC 3339 defines partial-time as a two-digit hour, a colon, a two-digit minute, a colon and a two-digit second.[3]
Use
The value of an HTML time input is always in 24-hour format with leading zeros, HH:mm, regardless of the input format shown to the user.[4] An HTML time input's step defaults to 60 seconds, and with that default most browser time controls show hours and minutes but not seconds.[4] A web form's time input is submitted as name=HH%3Amm, or name=HH%3Amm%3Ass if seconds are included.[4]
OpenStreetMap's opening_hours key writes hours as a 2-digit number in 24-hour format, with no am/pm, and minutes as a 2-digit number.[5] OpenStreetMap's opening_hours syntax allows extended hours past midnight, so Mo 20:00-26:00 means open Monday from 20:00 until 2:00 the next morning.[5] The GTFS transit feed specification writes times as HH:MM:SS and records times after midnight on the service day as values greater than 24:00:00.[6] Some bus and train timetables show 00:00 as a departure time and 24:00 as an arrival time.[1]
Style guides and military communication regulations in some English-speaking countries discourage 24:00 and recommend times near midnight be reported as 23:59 or 00:01 instead.[1] In the past, some European countries used the dot on the line as the separator in 24-hour times.[1] A value like 10.30 in an older European file may be a time of day rather than a decimal, so read the column header and neighbouring values before treating it as a number. (Meridian's view)
Sources
- [1]24-hour clocksecondary source
- [2]ISO 8601secondary source
- [3]RFC 3339: Date and Time on the Internet: Timestampsstandard
- [4]<input type="time"> HTML attribute value - HTML | MDNdocumentation
- [5]Key:opening_hoursdocumentation
- [6]Reference - General Transit Feed Specificationdocumentation
Detection notes
NEW in v2.
Use it
$ finetype infer -i "10:30" --mode column
→ datetime.time.hm_24h
SELECT ft_infer('10:30');
-- → 'datetime.time.hm_24h'strptime({col}, '%H:%M')::TIME
-- Format: %H:%MSchema
https://meridian.online/schemas/datetime.time.hm_24h · Frictionless type time · %H:%M
finetype taxonomy datetime.time.hm_24h -o json-schema