Skip to content

Commit

Permalink
fix on Windows, tzset is only available on *nix systems
Browse files Browse the repository at this point in the history
  • Loading branch information
marregui committed Oct 3, 2023
1 parent e26014c commit 6dfc493
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/questdb_connect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@
# Although timestamps in nanoseconds will be parsed, the output will be truncated to
# microseconds. QuestDB does not store time zone information alongside timestamp values
# and therefore it should be assumed that all timestamps are in UTC.
os.environ["TZ"] = "UTC"
time.tzset()
if hasattr(time, 'tzset'):
os.environ["TZ"] = "UTC"
time.tzset()

# ===== DBAPI =====
# https://peps.python.org/pep-0249/
Expand Down

0 comments on commit 6dfc493

Please sign in to comment.