Data Table vs Database Query : Date data type?

When I view data with a Data Table the date column (_time) has date and time as per the data source. When I do the exact same with a SQL Query it only shows the date part (not the time).

I tried different ways to convert and cast with no luck.

Anyone here that have an idea?

All the Best,
Henrik

Hey @henrikljungberg5467 ! Thanks for surfacing this issue (definitely confusing)! I’ve put together a notebook explaining why this happens and how to get around it.

In short, DuckDB, which we use to support queries of JavaScript objects in the SQL cell, converts (or rounds) the date to a whole day (not a timestamp).

We’ll file an issue and look into that later, but for now, you can get around this by creating a string representation of your date, as using the CAST statement below.

select *, CAST(stringDate as timestamp) as dateTime from data

Let me know if you have any followup questions!