- Joined
- Oct 10, 2019
- Messages
- 216
- Reaction score
- 1,482
List of available time zones:Is there any command to change the server time?
Bash:
timedatectl list-timezones
Filter the list:
Bash:
timedatectl list-timezones | grep "Europe"
Change server timezone:
Bash:
timedatectl set-timezone "Europe/London"
Note that this only changes the timezone for the main server. If you want the DB to have the same timezone, you need to rebuild the container image with the correct timezone. Then create the Cabal server.
Bash:
# Create a directory for building mssql
mkdir -p mssql
cd mssql
# Creating a DOCKERFILE for mssql (change TZ here)
cat > Dockerfile <<EOF
FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt-get -y update && \
apt-get install -y tzdata && \
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
CMD [ "/opt/mssql/bin/sqlservr" ]
EOF
# Creating an image with a set time zone
docker build --rm --no-cache -t mssql-tz-2022 .
cd
Finally, I recommend setting the correct time zone in the installer.
Changing the time zone on an already installed server can cause problems that are difficult to deal with if you are not familiar with Linux and Docker.


