Hubert-Dudek
Databricks MVP

It will be like that if you manipulate seconds. As getdate() includes seconds, it will be that object, but if you make select typeof(getdate() + INTERVAL 1 DAY), it will be a timestamp.

Maybe having seconds as integer guaranteed from midnight will be the best:

select CAST(current_timestamp() AS INT) - CAST(timestamp(current_date()) AS INT)


My blog: https://databrickster.medium.com/