The important question is - why do you need to cast? It can be problematic, as TIMESTAMP may contain millisecond (and possibly timezone), while DATE cannot. The cast will strip off this information if present and therefore might produce value different from what you set via setTimestamp(). If it happened, it would alter the results of your query.
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.