-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
What happens?
Incorrect timezone conversion.
To Reproduce
from datetime import datetime, timezone
import duckdb
dt = datetime.now(timezone.utc).replace(microsecond=0)
print(dt)
q = "CREATE TABLE IF NOT EXISTS test (uid INT, dt TIMESTAMPTZ)"
duckdb.execute(q).commit()
q1 = "INSERT INTO test VALUES (?, ?)"
duckdb.execute(q1, (1, dt)) # BUG time zone
duckdb.execute(q1, (2, str(dt)))
duckdb.commit()
duckdb.sql("SELECT * FROM test").show()
2023-02-25 21:02:54+00:00
┌───────┬──────────────────────────┐
│ uid │ dt │
│ int32 │ timestamp with time zone │
├───────┼──────────────────────────┤
│ 1 │ 2023-02-25 21:02:54+05 │
│ 2 │ 2023-02-26 02:02:54+05 │
└───────┴──────────────────────────┘
OS:
Linux x64, Windows x64
DuckDB Version:
0.7.0
DuckDB Client:
Python
Full Name:
Leo
Affiliation:
private
Have you tried this on the latest master
branch?
- I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- I agree
davetapley
Metadata
Metadata
Assignees
Labels
No labels