Linux - Execute Your Program in a Different Timezone

tokosh(25)
Published in
#linux
Words
42
Reading
1 min
9y
Listen to this post
~1 min

It is sometimes handy to temporarily change the timezone in order to test something or run a program under a certain condition. You can do this by setting the environment variable TZ to your preferred timezone.

Example: TZ=Asia/Tokyo ./my_program

I tested this only on Ubuntu.

Linux - Execute Your Program in a Different Timezone | Ecency