-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hello Oli,
thanks for providing the code.
I would expect an offset of one hour during the DST change at Sunday, 2025-03-30 in Berlin, referring to your example:
=> SELECT event, time AT TIME ZONE 'Europe/Berlin' FROM get_sun_times(TIMESTAMP '2025-03-29', 52.5206828, 13.409282, 239) WHERE event = 'sunset';
event | timezone
--------+----------------------------
sunset | 2025-03-28 17:37:25.239133
(1 row)
=> SELECT event, time AT TIME ZONE 'Europe/Berlin' FROM get_sun_times(TIMESTAMP '2025-03-30', 52.5206828, 13.409282, 239) WHERE event = 'sunset';
event | timezone
--------+----------------------------
sunset | 2025-03-29 17:39:09.857757
(1 row)
=> SELECT event, time AT TIME ZONE 'Europe/Berlin' FROM get_sun_times(TIMESTAMP '2025-03-31', 52.5206828, 13.409282, 239) WHERE event = 'sunset';
event | timezone
--------+----------------------------
sunset | 2025-03-30 17:40:54.475374
(1 row)
=> SELECT event, time AT TIME ZONE 'Europe/Berlin' FROM get_sun_times(TIMESTAMP '2025-04-01', 52.5206828, 13.409282, 239) WHERE event = 'sunset';
event | timezone
--------+----------------------------
sunset | 2025-03-31 17:42:39.103856
(1 row)
Without conversation only the timezone changes, but not the value:
=> SELECT time,event from get_sun_times(TIMESTAMP '2025-03-30', 52.5206828, 13.409282, 239) WHERE event = 'sunset';
time | event
-------------------------------+--------
2025-03-29 17:39:09.857757+01 | sunset
(1 row)
=> SELECT time,event from get_sun_times(TIMESTAMP '2025-03-31', 52.5206828, 13.409282, 239) WHERE event = 'sunset';
time | event
-------------------------------+--------
2025-03-30 17:40:54.475374+02 | sunset
(1 row)
Due to my understanding the time-value is in local-time of timezone-offset.
Metadata
Metadata
Assignees
Labels
No labels