Abstract


  • A standard to the current date and time at different parts of the world

Change Timezone


Timezone Code

Refer to this List of timezone codes.

System-level

  • sudo timedatectl set-timezone <TIMEZONE_CODE> on POSIX

Process-level

  • Install tzdata(a time zone database) into the system with a Package Manager and set the timezone with export TZ=<TIMEZONE_CODE>
  • Docker Container is a Process (进程), so setting timezone in this matter is similar to setting a system-level timezone for the application running inside the container

Application-level

  • Set it with the corresponding SDK of the language used to code the app

System-level vs Process-level

As you can see changing timezone on a process level doesn’t affect the system-level timezone. And all processes follow the system-level timezone by default.