MCPcopy Create free account
hub / github.com/tiny-pilot/tinypilot / _to_iso_string

Function _to_iso_string

app/db/users.py:93–101  ·  view source on GitHub ↗

Returns the timestamp (datetime.datetime) as ISO8601 formatted string.

(timestamp)

Source from the content-addressed store, hash-verified

91
92
93def _to_iso_string(timestamp):
94 """Returns the timestamp (datetime.datetime) as ISO8601 formatted string."""
95 # Without `timespec='microseconds`, the `isoformat` function would truncate
96 # the fractional seconds part if it’s zero. However, we store timestamps
97 # as plain strings in the database, so that inconsistent serialization
98 # behaviour would make it tricky to perform queries on that value.
99 # E.g.: 2000-01-01T00:00:00.000000 and 2000-01-01T00:00:00 are logically
100 # equal, but a text-based comparison would fail.
101 return timestamp.isoformat(timespec='microseconds')

Callers 3

addMethod · 0.85
change_passwordMethod · 0.85
change_roleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected