Skip to content

Commit

Permalink
Always save previews in UTC offset (#11629)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored May 29, 2024
1 parent 37dd3fc commit 9fc22ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frigate/output/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def __init__(self, config: CameraConfig) -> None:
# end segment at end of hour
self.segment_end = (
(datetime.datetime.now() + datetime.timedelta(hours=1))
.astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0)
.timestamp()
)
Expand All @@ -192,6 +193,7 @@ def __init__(self, config: CameraConfig) -> None:
# check for existing items in cache
start_ts = (
datetime.datetime.now()
.astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0)
.timestamp()
)
Expand Down Expand Up @@ -300,6 +302,7 @@ def write_data(
# reset frame cache
self.segment_end = (
(datetime.datetime.now() + datetime.timedelta(hours=1))
.astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0)
.timestamp()
)
Expand Down

0 comments on commit 9fc22ef

Please sign in to comment.