marcoraddatz / homebridge-docker

Dockerized Homebridge. No plugins pre-defined, hassle-free setup. Read instructions!
Apache License 2.0
127 stars 47 forks source link

container 2 hours behind #32

Closed GravityRZ closed 6 years ago

GravityRZ commented 6 years ago

this seems to be a very old issue. do not know if this is realted to docker or setting a TZ environment in the docker file

is there a way to set the timezone for this container or perhaps copy it from the system.

it is using UTC while i am in CEST(europe)

marcoraddatz commented 6 years ago

I've tested setting the timezone via the TZ variable and it seems to work. Could you try it for your container?

marcoraddatz commented 6 years ago

Also, I just added a manual timezone support and pushed it to the develop branch: https://github.com/marcoraddatz/homebridge-docker/tree/develop#homebridge_timezone Thanks for reporting!

GravityRZ commented 6 years ago

i tried that but did not work do i need to use another vaiable? tz

marcoraddatz commented 6 years ago

Yes, it should be the timezone: F.e. TZ=Europe/Berlin

Alternatively you can use the develop branch and set the HOMEBRIDGE_TIMEZONE.

GravityRZ commented 6 years ago

tried it, still not working. to be sure we are talking about the same thing. at the entry millieu i add the variabel TZ=Europe/Berlin i check the time which is displayed in the log when the container starts up. this time is 2hours behind.

i also read that mapping /etc/localtime to /etc/localtime works but it does not. i can not map /etc so i copied local time to /docker and mapped that file to /etc/localtime. still not working

marcoraddatz commented 6 years ago

Yes, we're talking about the same thing. I set up my container with docker run -e TZ=Europe/Berlin xxxx and it all loaded. The feature I added yesterday (and which is only available in the develop branch so far) modifies the etc/localtime, as you said: https://github.com/marcoraddatz/homebridge-docker/blob/develop/image/run.sh#L57

GravityRZ commented 6 years ago

ok so maybee the TZ variable only gets accepted through the commandline and not the gui. (will test)

how can i get that latest branch image?(github is a mystery to me)

GravityRZ commented 6 years ago

tried commandline: not working. still 2 hours behind

marcoraddatz commented 6 years ago

Pretty strange. However: You can also get the latest version via Docker Hub, simply select "develop" from the list of available downloads: https://raw.githubusercontent.com/marcoraddatz/homebridge-docker/master/doc/docker-1.png

GravityRZ commented 6 years ago

well, downloaded new image, build new container, added new variable but still 2 hours behind.

hopefully the variable setting is wrong otherwise i am out of luck

tz2

marcoraddatz commented 6 years ago

Sorry for the confusion: The HOMEBRIDGE_TIMEZONE must be set in the .env file, which is in the samples folder and must be placed next to the config.json. https://github.com/marcoraddatz/homebridge-docker/tree/develop#env-options

GravityRZ commented 6 years ago

Ahh. ok now i know what to do but i still get the error .env not found there is a .env file in the docker/homebridge directory. the same directory as al the other config files

env

GravityRZ commented 6 years ago

don't ask why but somehow the .env file got found. still 2 hours behind while i pulled the latest development version

i will give up on this since this is taking up alot of time

tz3

marcoraddatz commented 6 years ago

Can absolutely understand that. Will test that on other machines! Thanks for your efforts!

marcoraddatz commented 6 years ago

I just tested this option and works as supposed. (Docker is one hour behind, but the container sets the correct date).

bildschirmfoto 2017-12-17 um 15 59 03