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.