# ISO Datetime with Microseconds (no timezone)

Key: `datetime.timestamp.iso_microseconds`

ISO 8601-like format with microsecond precision but no timezone indicator. Common in database exports and log files.

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

Format: `%Y-%m-%dT%H:%M:%S.%f`

Samples: `2024-01-15T10:30:00.123456`, `2019-12-31T23:59:59.000000`

## Background

### Origin

ISO 8601 was first published as ISO 8601:1988 in June 1988.[[1]](https://en.wikipedia.org/wiki/ISO_8601) The revision ISO 8601-1:2019 was issued in February 2019.[[1]](https://en.wikipedia.org/wiki/ISO_8601) ISO 8601 combines a date and a time using the letter T as a delimiter.[[1]](https://en.wikipedia.org/wiki/ISO_8601) ISO 8601 allows a decimal fraction to be added to the lowest order time element present.[[1]](https://en.wikipedia.org/wiki/ISO_8601) ISO 8601 leaves the number of decimal places to be agreed by the communicating parties.[[1]](https://en.wikipedia.org/wiki/ISO_8601) Under ISO 8601, a time given with no UTC relation information is assumed to be in local time.[[1]](https://en.wikipedia.org/wiki/ISO_8601) Read the six fractional digits as a habit of the system that wrote the value, not a rule of ISO 8601 itself. (Meridian's view)

### Use

Python's datetime.isoformat() returns YYYY-MM-DDTHH:MM:SS.ffffff when the microsecond is not 0.[[2]](https://docs.python.org/3/library/datetime.html) Python's datetime.isoformat() returns YYYY-MM-DDTHH:MM:SS, with no fraction, when the microsecond is 0.[[2]](https://docs.python.org/3/library/datetime.html) Python's datetime.isoformat() appends a UTC offset only when utcoffset() does not return None.[[2]](https://docs.python.org/3/library/datetime.html) Passing timespec='microseconds' to Python's isoformat() includes the full time in HH:MM:SS.ffffff format.[[2]](https://docs.python.org/3/library/datetime.html) If a column mixes this shape with values that stop at the seconds, suspect a Python program using the default isoformat() and parse both shapes. (Meridian's view)

In Python's strftime(), the %f directive is the microsecond as a decimal number, zero-padded to 6 digits.[[2]](https://docs.python.org/3/library/datetime.html) With Python's strptime(), the %f directive accepts from one to six digits and zero pads on the right.[[2]](https://docs.python.org/3/library/datetime.html)

PostgreSQL's timestamp without time zone type has a resolution of 1 microsecond.[[3]](https://www.postgresql.org/docs/current/datatype-datetime.html) PostgreSQL accepts the T separator on input but uses a space rather than T on output.[[3]](https://www.postgresql.org/docs/current/datatype-datetime.html) PostgreSQL silently ignores any time zone indication in a value determined to be timestamp without time zone.[[3]](https://www.postgresql.org/docs/current/datatype-datetime.html) DuckDB describes its TIMESTAMP type as a naive timestamp with microsecond precision.[[4]](https://duckdb.org/docs/current/sql/data_types/timestamp.html) DuckDB lists DATETIME as an alias of TIMESTAMP.[[4]](https://duckdb.org/docs/current/sql/data_types/timestamp.html) A value with no offset says nothing about which clock it was read from, so find the zone in the source's documentation before you compare it with anything else, and do not assume UTC. (Meridian's view)

MDN states that the timezone of toISOString() output is always UTC, as denoted by the suffix Z.[[5]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)

## Sources

1. [ISO 8601 - Wikipedia](https://en.wikipedia.org/wiki/ISO_8601) — secondary source
2. [datetime — Basic date and time types — Python 3.15.0 documentation](https://docs.python.org/3/library/datetime.html) — documentation
3. [8.5. Date/Time Types](https://www.postgresql.org/docs/current/datatype-datetime.html) — documentation
4. [Timestamp Types](https://duckdb.org/docs/current/sql/data_types/timestamp.html) — documentation
5. [Date.prototype.toISOString() - JavaScript \| MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) — documentation
