Timezone Setting

Hi to all,

I have selfhosted leantime on my server and is running awesome until I go track the discussion. As I scroll through discussion I noticed the time was weird and I tried adding new comment and boom! timezone is set to another timezone. I have checked my server timezone and it’s correct.

I have done the following things to fix it myself but to no avail:

  • Modified /data/config/settings.php >> date_default_timezone_set(<<my timezone>>)
  • Passed my system timezone (/etc/timezone) and localtime (/etc/localtime) setting to container

Here is my compose file also:

version: ‘3’

services:
mysql:
image: mysql:5.7
container_name: leantime-mysql
volumes:
- ./db_data:/var/lib/mysql
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
restart: always
environment:
MYSQL_ROOT_PASSWORD: ‘//redacted//’
MYSQL_DATABASE: ‘leantime’
MYSQL_USER: ‘admin’
MYSQL_PASSWORD: ‘//redacted//’
ports:
- “3306:3306”
command: --character-set-server=utf8 --collation-server=utf8_unicode_ci
web:
image: leantime/leantime:latest
container_name: leantime
environment:
LEAN_DB_HOST: ‘leantime-mysql’
LEAN_DB_USER: ‘admin’
LEAN_DB_PASSWORD: ‘//redacted//’
LEAN_DB_DATABASE: ‘leantime’
volumes:
- ./data/userfiles:/var/www/html/userfiles
- ./data/public/userfiles:/var/www/html/public/userfiles
- ./data/logs:/var/www/html/resources/logs
- ./data/config:/var/www/html/config
- ./data/customImage:/var/www/html/public/images/custom
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- “9000:9000”
depends_on:
- mysql

Hoping that someone can help me. Thanks!

Regards,
John