This code on Trino/Presto says that the day difference is 22:
with period as (
select
timestamp '2017-01-09 10:49:49' as period_start,
timestamp '2017-02-01 07:02:32' as period_end
)
select date_diff('day', period_start, period_end) as duration_days
from period
Snowflake says 23:
with period as (
select
timestamp '2017-01-09 10:49:49' as period_start,
timestamp '2017-02-01 07:02:32' as period_end
)
select datediff(day, period_start, period_end) as duration_days
from period;
Why are the results of datediff different?
(source: conversation with a customer)