skip to Main Content

Postgresql – Generate timestamp series between given dates

Given min and max dates are: Min date: 2023-06-19 09:54:23.000 Max date: now()::timestamp(0)-interval '1 year' Expected output: start_date end_date ------------------------------------------- 2023-12-01 00:00:00.000 2023-12-09 23:59:59.999 2023-11-01 00:00:00.000 2023-11-30 23:59:59.999 2023-10-01 00:00:00.000 2023-10-31 23:59:59.999 2023-09-01 00:00:00.000 2023-09-30 23:59:59.999 2023-08-01 00:00:00.000 2023-08-31 23:59:59.999…

VIEW QUESTION
Back To Top
Search