Or DATE - which is a var - gets typecasted to int?

This would explain why tod(DATE) returns 0, but not why ldow() returns the previous day..

But then this would mean that all time-returning functions do not really work when passed a DATE, and the manual creates wrong expectations...