blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.82k stars 1.71k forks source link

How to setup Frigate datetime zone? #771

Closed lukaszolek closed 2 years ago

lukaszolek commented 3 years ago

All my frigate clips have names with wrong timezone (Home Assistant is set up to Europe/Warsaw).

Events show correct time:

image

But media browser shows:

image

It would be also great if clip names would be formatted using my local datetime format (eg. 10.02.2021 14:05).

blakeblackshear commented 3 years ago

Are you running with the addon?

lukaszolek commented 3 years ago

Yes, frigate is installed as a Supervisor addon

paularmstrong commented 3 years ago

The Web UI is able to know about your local datetime formatting because it's done in JavaScript. The formatting in the media browser in HA comes from another source, the Frigate custom component/integration, which is in Python and has no knowledge of your local date/time formatting. If HA exposes a formatter to custom components, maybe that could be used, but barring that, we have to use a single datetime formatting for everyone.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ee02217 commented 3 years ago

Hi! I have this running as a docker and I have the similar issue.

Event date with Europe format: image

The detecton camera provided by the frigate integration presents american date format: image

SebbeM commented 3 years ago

I have the same problem. It would be nice to be able to change this with an environment variable but I would argue that it should default to ISO-8601 and not American format.

Alfiegerner commented 3 years ago

I was thinking the timezones of the environment of the docker container could be passed via api to HomeAssistant integration. Though not sure if this would help those using the HA Addon as have no experience of that.

EmilyNerdGirl commented 3 years ago

Just adding my input to this too, running as a container in k8s here, and the timestamps and exposing the timezone as an env variable would be great if possible.

maphilli14 commented 2 years ago

Any solutions to this? It's kind of annoying to do the math for a single timezone that my HOME network spans!

yanfali commented 2 years ago

I'm in US timezone, but it's still off. My docker timezone is PST, but it seems to be in CST. I'm running docker image e64648364690. The timezones in both frigate:5000 and the integration in HA are off by an hour. I also think it would be awesome if the docker container defaulted to Zulu/GMT+0, that way you could compare logs against containers

Screenshot 2022-06-03 16 27 05

Camera timestamp is PST, but frigate obviously thinks it's in the wrong timezone. The machine itself is set correctly to PST. I suppose I could fix this by volume mounting a timezone file into /etc. Oh looks like I already did that...

Never mind, my cameras are wildly off. Mea culpa

NickM-27 commented 2 years ago

I'm in US timezone, but it's still off. My docker timezone is PST, but it seems to be in CST. I'm running docker image e64648364690. The timezones in both frigate:5000 and the integration in HA are off by an hour. I also think it would be awesome if the docker container defaulted to Zulu/GMT+0, that way you could compare logs against containers

Screenshot 2022-06-03 16 27 05

Camera timestamp is PST, but frigate obviously thinks it's in the wrong timezone. The machine itself is set correctly to PST. I suppose I could fix this by volume mounting a timezone file into /etc. Oh looks like I already did that...

Never mind, my cameras are wildly off. Mea culpa

Are you passing /etc/localtime to the container?

yanfali commented 2 years ago

I am, though because it's a softlink on the local host I switched it to the actual file. The issue was the camera wasn't syncing with NTP anymore so the timestamp in the picture was out of sync. Firmware problems.

gadgetbazza commented 2 years ago

Are you passing /etc/localtime to the container?

Sorry for the noob question, but how do I do this? The recording filenames are 1 hour out (UTC?) from the actual time here (BST)?

Thanks

NickM-27 commented 2 years ago

@gadgetbazza what installation method are you using? (docker CLI, docker compose, addon?)

gadgetbazza commented 2 years ago

A basic form of Docker Compose... Im running QNAP Container Station!

NickM-27 commented 2 years ago

@gadgetbazza This is what it would look like in docker compose:

services:
  frigate:
    ...
    volumes:
      - /etc/localtime:/etc/localtime:ro
    ...
gadgetbazza commented 2 years ago

Thanks, easy when you know how. That's sorted it for me... Thanks very much for the swift assist!

ljmerza commented 1 year ago

my events times are correct but the recordings where the video files go are still wrong. events for 12-1pm are in the 18 folder

NickM-27 commented 1 year ago

my events times are correct but the recordings where the video files go are still wrong. events for 12-1pm are in the 18 folder

like has been said previously, Frigate stores recordings in UTC folder structure. User is not supposed to be interacting with the files directly, that is why there is an API / WebUI

ljmerza commented 1 year ago

how is that supposed to work? i can onlysee events not recordings or general movement? pretty limited

NickM-27 commented 1 year ago

the webui only allows me to see events? no motion or general recordings so how does that even work out??

You use the 24/7 recordings viewer

Screen Shot 2023-08-21 at 11 19 45 AM

ljmerza commented 1 year ago

it says Dates and times are based on the timezone America/Port-au-Prince which makes no sense as i have the timezone set to EST

NickM-27 commented 1 year ago

it says Dates and times are based on the timezone America/Port-au-Prince which makes no sense as i have the timezone set to EST

most likely you haven't configured that correctly then, but that is an entirely separate issue

Max101 commented 1 year ago

I have installed Frigate as a docker container too, and I am passing in /etc/localtime which shows up the correct time, however the snapshots time is still UTC and not the time I am passing in with /etc/localtime so is there a way to fix this so that the snapshot time matches the current time zone?

pos-ei-don commented 1 year ago

Same here

mr2k24 commented 9 months ago

@NickM-27 When I click the "Recordings" button on the camera I only see a summary of events (Frigate 0.12.1). Is there a delay for when 24/7 recordings are available?

NickM-27 commented 9 months ago

@mr2k24 it's not a summary, click any hour and you can view it

mr2k24 commented 9 months ago

@NickM-27 Thanks for the fast reply! You're right, I didn't notice each hour was segmented as an "events".

I just set up Frigate so I am still figuring things. Thanks again!