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.