Skip to content

Commit 737e63e

Browse files
committed
ensure we use the same time zone as the start_time param
1 parent 734ff2b commit 737e63e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/database/queries/insights.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -774,11 +774,11 @@ GROUP BY utp.num, utp.template_ids, utp.name, utp.type, utp.display_name, utp.de
774774

775775
-- name: GetUserStatusChanges :many
776776
WITH dates AS (
777-
SELECT generate_series(
777+
SELECT (generate_series(
778778
date_trunc('day', @start_time::timestamptz),
779779
date_trunc('day', @end_time::timestamptz),
780780
'1 day'::interval
781-
)::timestamptz AS date
781+
) AT TIME ZONE (extract(timezone FROM @start_time::timestamptz)::text || ' minutes'))::timestamptz AS date
782782
),
783783
latest_status_before_range AS (
784784
-- Get the last status change for each user before our date range

0 commit comments

Comments
 (0)