# SQL Minute-Precision Datetime

Key: `datetime.timestamp.sql_minutes`

Space-separated date and time to minute precision, without seconds or timezone (e.g. 2024-01-15 10:30). The minute-precision sibling of sql\_standard; DuckDB parses it natively as a TIMESTAMP (padding :00). Common in spreadsheet and database exports that drop the seconds field.

Page: <https://meridian.online/docs/projects/finetype/types/datetime/timestamp/sql_minutes>

Format: `%Y-%m-%d %H:%M`

Samples: `2024-01-15 10:30`, `2019-12-31 23:59`

## Background

### Origin

FineType defines the sql\_minutes type itself, as a space-separated date and time to minute precision with no seconds or time zone.[[1]](https://github.com/meridian-online/finetype/blob/main/labels/definitions_datetime.yaml) FineType's label for the type gives the format string %Y-%m-%d %H:%M.[[1]](https://github.com/meridian-online/finetype/blob/main/labels/definitions_datetime.yaml)

ISO 8601 was first published in 1988.[[2]](https://en.wikipedia.org/wiki/ISO_8601) ISO 8601 allows the seconds, or the minutes and seconds, to be omitted from a time for greater brevity, at the cost of precision.[[2]](https://en.wikipedia.org/wiki/ISO_8601) ISO 8601 does not allow a space to separate the date and time parts.[[2]](https://en.wikipedia.org/wiki/ISO_8601)

RFC 3339, Date and Time on the Internet: Timestamps, was written by G. Klyne and C. Newman and published in July 2002.[[3]](https://www.rfc-editor.org/rfc/rfc3339) RFC 3339 notes that applications may choose, for the sake of readability, to separate the full date and full time with a space character rather than the T that ISO 8601 defines.[[3]](https://www.rfc-editor.org/rfc/rfc3339) RFC 3339's timestamp grammar still requires the seconds field.[[3]](https://www.rfc-editor.org/rfc/rfc3339) A value like 2024-01-15 10:30 is best read as a blend of the two: ISO 8601's permission to stop at the minute, written with RFC 3339's readable space. (Meridian's view)

### Use

PostgreSQL accepts the ISO 8601 T separator on input but writes a space on output, for readability and for consistency with RFC 3339 and some other database systems.[[4]](https://www.postgresql.org/docs/current/datatype-datetime.html) PostgreSQL's table of time input forms lists 04:05, with no seconds, as an ISO 8601 form.[[4]](https://www.postgresql.org/docs/current/datatype-datetime.html) SQLite's date and time functions list YYYY-MM-DD HH:MM among the time value formats they accept.[[5]](https://sqlite.org/lang_datefunc.html) MySQL's reference manual describes DATETIME and TIMESTAMP string values in the 'YYYY-MM-DD hh:mm:ss' format.[[6]](https://dev.mysql.com/doc/refman/8.4/en/date-and-time-literals.html) MySQL's reference manual says the date and time parts can be separated by T rather than a space.[[6]](https://dev.mysql.com/doc/refman/8.4/en/date-and-time-literals.html) Python's datetime.fromisoformat documentation says the T separator may be replaced by any single unicode character.[[7]](https://docs.python.org/3/library/datetime.html)

Treat a minute-precision timestamp as one that has lost its seconds rather than one that never had any: 10:30 could stand for any moment from 10:30:00 to 10:30:59. (Meridian's view) Parse the column with an explicit format string such as %Y-%m-%d %H:%M rather than relying on a parser's guess. (Meridian's view) Check whether the same column mixes minute-precision values with values that carry seconds before choosing one format for all of it. (Meridian's view) Nothing in the value says which time zone it was written in, so find that out from the source before comparing it with timestamps from elsewhere. (Meridian's view)

## Sources

1. [finetype/labels/definitions\_datetime.yaml at main · meridian-online/finetype](https://github.com/meridian-online/finetype/blob/main/labels/definitions_datetime.yaml) — FineType
2. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) — secondary source
3. [RFC 3339: Date and Time on the Internet: Timestamps](https://www.rfc-editor.org/rfc/rfc3339) — standard
4. [PostgreSQL: Documentation: 18: 8.5. Date/Time Types](https://www.postgresql.org/docs/current/datatype-datetime.html) — documentation
5. [Date And Time Functions](https://sqlite.org/lang_datefunc.html) — documentation
6. [MySQL :: MySQL 8.4 Reference Manual :: 11.1.3 Date and Time Literals](https://dev.mysql.com/doc/refman/8.4/en/date-and-time-literals.html) — documentation
7. [datetime — Basic date and time types](https://docs.python.org/3/library/datetime.html) — documentation
