generate_series
(
start
timestamp with time zone
,
stop
timestamp with time zone
,
step
interval
)
produces results depending on the timezone value set:
SET timezone = 'UTC';
SELECT ts, ts AT TIME ZONE 'UTC'
FROM generate_series('2022-03-26 00:00:00+01'::timestamptz, '2022-03-30 00:00:00+01'::timestamptz, '1 day') AS ts;
SET timezone = 'Europe/Warsaw';
SELECT ts, ts AT TIME ZONE 'UTC'
FROM generate_series('2022-03-26 00:00:00+01'::timestamptz, '2022-03-30 00:00:00+01'::timestamptz, '1 day') AS ts;
Sometimes this is a very big problem.
The fourth argument with the time zone will be very useful:
generate_series
(
start
timestamp with time zone
,
stop
timestamp with time zone
,
step
interval
[, zone text] )
The situation is similar with the function timestamptz_pl_interval. The third parameter for specifying the zone would be very useful.
--
Przemysław Sztoch | Mobile +48 509 99 00 66