Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
castorp
· 4y ago · 0 comments
I never understood the need for a datediff function. In Postgres (or Oracle) you just subtract two timestamps and use the resulting interval. It's a different approach to the same problem.
Comments
[–]
michael-ax
4y ago
one is counting distance, the other one buckets. alias the fn name to datebucketdelta to make the different problems memorable individually. :)
[–]
castorp
OP
4y ago
Well for "counting buckets" you can use `date_bin()` since Postgres 14 which groups the difference between timestamps into defined intervals.