Last occurance of time relative to now() What's the most elegant way to ask Postgres for the last 4:05pm relative to now()?

I have been writing a fairly elaborate CASE with date_trunc's and my guess is it can be accomplished in a much cleaner manner.

I speak with reference to no table. i.e. There is no FROM in this query. Just a simple SELECT.

The result of this is either a TIMESTAMP at 4:05pm today, or yesterday.
The logic is similar to what @Daniel already posted, but this is a bit faster (twice as fast in my tests on pg 9.3):

SELECT CASE WHEN now()::time &gt; time '16:05'
            THEN now()::date + time '16:05'
            ELSE (now()::date - 1) + time '16:05' END AS ts;


now() is the Postgres implementation of the SQL standard CURRENT_TIMESTAMP (which you can use as well). I use now(), because it is shortest and fastest. CURRENT_TIME and CURRENT_DATE are implemented with now() as well.

Note that you get a timestamp [without time zone] that is interpreted according to your current time zone setting.