I’m using GridDB Cloud (Free Tier) with the official Python client (latest pip release) on Ubuntu 22.04.
My container schema looks like this:
device_id STRING,
created_at TIMESTAMP,
temperature DOUBLE
I’m trying to insert rows with the current timestamp. My code:
from datetime import datetime
row = ["sensor_1", datetime.now(), 21.5]
container.put(row)
But this throws the following error:
griddb.TimeConversionError: Invalid format for TIMESTAMP
I also tried converting the datetime into ISO format:
row = ["sensor_1", datetime.now().isoformat(), 21.5]
What I tried & expected:
I expected datetime.now() to be accepted directly, since the column type is TIMESTAMP.
I also tried using .isoformat() strings, but that didn’t work either.
I checked the docs, but couldn’t find a clear example for inserting Python datetime values.
Question:
What’s the correct way to insert Python datetime objects into a TIMESTAMP column in GridDB Cloud? Do I need to convert it into a specific string format, or is there native support for datetime in the Python client?