mathielo / dst-dedicated-server

Don't Starve Together dedicated server guide for all platforms (Linux, Mac, Windows) with Docker. Extensive documentation covering mods installation, server config and performance, world generation and setting up admins.
MIT License
296 stars 56 forks source link

How to change dedicated server timezone? #24

Open Fieel opened 4 years ago

Fieel commented 4 years ago

Hello,

I'd like to know how to change/update my dedicated server timezone, it clearly isn't using my OS timezone and I'd love to have my logs, well, logged with a correct time which is not the case as of now.

How to update the timezone? Is it possible?

addianto commented 4 years ago

Good day,

Disclaimer: I am not sure whether this will solve your question because I haven't tried this on running DST containers. However, I have used this approach for setting up timezone of my personal servers in the cloud.

You can try setting TZ environment variable of your Bash shell to a timezone string that available in tz database. Since the server running as Docker containers and orchestrated via docker-compose.yml, you need to set TZ variable in both container's environment property. For example:

version: '3'
services:
  dst_master:
    # omitted other properties for brevity
    environment:
      - SHARD_NAME=Caves
      - TZ=Asia/Bangkok
  dst_caves:
    # ...
    environment:
      - SHARD_NAME=Master
      - TZ=Asia/Bangkok
# ...