Re:PostgreSQL's Missing DateDiff Function
by nicoburns on Tuesday December 21, 2021 @06:13PM
(#29643281)
I think they want a function that output "1 year" given those two dates + "years" as arguments.
[ Parent
| on HN ]
Re:PostgreSQL's Missing DateDiff Function
by castorp on Wednesday December 22, 2021 @08:08AM
(#29648796)
But the difference between 2021-01-01 and 2020-12-31 is only one day, not a year.
It gets even strange for e.g. select DATEDIFF(year, '2021-12-01', '2022-01-01') which still returns 1 even though that's a whole month. I don't see a use case for this kind of result
Re:PostgreSQL's Missing DateDiff Function
by erichocean on Tuesday December 21, 2021 @06:25PM
(#29643377)
Correct.