1

We are currently trying to implement KiwiTCMS into our workflow with docker. We've seen that it should be possible to change the timezone in KiwiTCMS by either changing the environment variable KIWI_TIME_ZONE or TIME_ZONE in the settings.

We therefore tried either setting the environment variable inside the docker-compose.yml as KIWI_TIME_ZONE: Europe/Berlin or adding a settings file as a volume where TIME_ZONE = 'Europe/Berlin'.

We've added the settingsfile called default_config.py into the docker-compose.yml as follows:

volumes:
    - ./my_settings_dir/default_config.py:/venv/lib64/python3.8/site-packages/tcms_settings_dir/default_config.py

The volume looks to be implemented correctly because other settings we change inside the same file work. But setting the timezone variable in either of those files only changes the name of the timezone next to the clock to Europe/Berlin but neither the time of the clock nor the time of the last userlogin change, they still show the UTC time.

The time of the server that is running the docker containers and the time of both docker containers (DB and Kiwi) is set to Europe/Berlin so that shouldn't be the issue.

We've seen that there was a GitHub issue around three years ago that mentioned the same problem and there were a few commits to fix that issue but somehow it still doesn't work for us.

So now we're not sure if our implementation is wrong or if it's something else that prevents us from changing the timezone.

Max Wagner
  • 11
  • 4

3 Answers3

0

But setting the timezone variable in either of those files only changes the name of the timezone next to the clock to Europe/Berlin but neither the time of the clock nor the time of the last userlogin change, they still show the UTC time.

Does the value of the web based clock match the value reported by date inside the container? You need to post the actual values so we can see what's happening.

If they don't match that likely means container isn't configured appropriately for the local timezone.

Alexander Todorov
  • 2,167
  • 3
  • 14
  • 13
  • I checked the date commands just now, and the date of the server itself was `Tue Nov 9 16:47:35 CET 2021`, the date in the web container was `Tue Nov 9 16:47:17 CET 2021` and the date in the db container was `Tue Nov 9 16:47:28 CET 2021`, so everything is set to CET, in Kiwi the Web-Clock is showing `Nov. 9, 2021, 3:46 p.m. Europe/Berlin`, so the UTC time. We set the Timezones in the containers by adding a volume in `docker-compose.yml` as follows: `- /etc/localtime:/etc/localtime:ro`. Maybe thats doing it wrong, but we couldn't find any other way to change the time of the container. – Max Wagner Nov 09 '21 at 15:52
  • Configuration seems legit but I can't tell what else could be wrong. Can you open a bug at https://github.com/kiwitcms/Kiwi/issues/new/choose with all of the details. This needs debugging in-place. – Alexander Todorov Nov 11 '21 at 19:28
0

We resolved the problem, thanks to eddywu on GitHub.

The solution was to set KIWI_USE_TZ: "True" in the docker-compose.yml. You could probably also set USE_TZ = True in the settings file.

Max Wagner
  • 11
  • 4
0

I tried all the listed settings, but the time in email and the creation / launch of UTC tests. The time of containers is the same everywhere, but kiwi still fixes the time UTC, but the correct time is displayed on the right.