Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] add remarks for time zones with temporal types #440

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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