A
A
Alex Fedorov2022-02-11 11:22:05
PostgreSQL
Alex Fedorov, 2022-02-11 11:22:05

Find how many days a user has been registered?

Hey! In the postgres table, I have a registration date in the format 2021-12-16 12:34:58.956416
How can I calculate how many FULL days have passed since the date of its registration?
i.e. 1 day 2 hours rounded up to 2 days.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Uspensky, 2022-03-08
@robben_55

select extract('day' from now() - '2021-12-16 12:34:58.956416'::timestamp);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question