Setting timezone when creating SQL Server container

Dick de Goede 1 Reputation point
2022-01-08T12:17:28.51+00:00

Hello,

To set a timezone when creating an SQL Server container you can add the environment variable TZ like this:

docker run --name sqlserver2019 -e "ACCEPT_EULA=Y" -e "TZ=Europe/Amsterdam" -e "SA_PASSWORD=xxxxx" -p 1401:1433 -d mcr.microsoft.com/mssql/server:2019-latest

You can also do it after creation and logging in to bash with tzselect and then pick the correct continent and country. This will explain you to do the same within the shell: TZ='Europe/Amsterdam'; export TZ

The above is a bit faster though when creating a new container ;-)

Developer technologies .NET Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.