New answers tagged

10

The documentation for AT TIME ZONE says: Converts an inputdate to the corresponding datetimeoffset value in the target time zone. When inputdate is provided without offset information, the function applies the offset of the time zone assuming that inputdate is in the target time zone. If inputdate is provided as a datetimeoffset value, then AT TIME ZONE ...


0

Use a CTE (or subquery) to compute the bounds of the search, then join it to your data table to extract the data: WITH search AS ( SELECT ts-interval '5 sec' AS lowbound, ts+interval '5 sec' AS hibound FROM generate_series(timestamp '2021-03-07', timestamp '2021-08-16', interval '80 sec') t(ts) ) SELECT * FROM time_intersections JOIN search ...


Top 50 recent answers are included