SELECT justify_interval(
'03.01.2024 15:00:02'::timestamp - '03.12.2010'::timestamp
) AS justified_interval
)
SELECT jsonb_build_object(
'years', EXTRACT(year FROM justified_interval),
'months', EXTRACT(month FROM justified_interval),
'days', EXTRACT(day FROM justified_interval),
'hours', EXTRACT(hour FROM justified_interval),
'minutes', EXTRACT(minute FROM justified_interval),
'seconds', EXTRACT(second FROM justified_interval)
) AS interval_components
FROM interval_diff;```