Skip to content

Commit

Permalink
[Python] add remarks for time zones with temporal types (#440)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefano Ottolenghi <[email protected]>
  • Loading branch information
robsdedude and stefano-ottolenghi authored Oct 14, 2024
1 parent 8797f96 commit 867b8b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python-manual/modules/ROOT/pages/data-types.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ For full documentation, see link:{neo4j-docs-base-uri}/api/python-driver/current
Temporal data types are implemented by the `neo4j.time` module.
It provides a set of types compliant with ISO-8601 and Cypher, which are similar to those found in Python's native `datetime` module.
To convert between driver and native types, use the methods `.from_native()` and `.to_native()` (does not apply to `Duration`).
This conversion is lossy, as the driver's types support nanosecond precision, while Python's native types do not.

Sub-second values are measured to nanosecond precision and the types are mostly compatible with link:https://pypi.org/project/pytz/[pytz].
Some timezones (e.g., `pytz.utc`) work exclusively with the built-in `datetime.datetime`.
[NOTE]
The driver's temporal types are designed to be used with link:https://pypi.org/project/pytz/[pytz].
Other `datetime.tzinfo` implementations (e.g., `datetime.timezone`, `zoneinfo`, `dateutil.tz`) are not supported and are unlikely to work well.

For a list of time zone abbreviations, see link:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List[List of tz database time zones].

Expand Down

0 comments on commit 867b8b2

Please sign in to comment.