I was surpassed by a difficult problem associated with changes in the time zone from summer savings to saving daylight.
I am trying to create a series of timestamps divided by 6 hours. Later it is combined with data with the corresponding time stamps at 00, 06, 12, 18 hours for each day in the data set.
This works fine, using:
generate_series(extract(epoch from start_ts)::integer, extract(epoch from end_ts)::integer, 21600)
where start_ts is 00 hr on the first date, and end_ts is 00 hr on the exclusive last date.
However, when the time zone offset goes from +11 to +10 halfway through the series, it will no longer correspond to any records, since the elements of the series lose 1 hour.
Does anyone have any suggestions on how to generate a series of βera integersβ or timestamps that will correspond to 00.06, 12.18 hours timestamps while respecting the time zone offset?
source
share