This article describes how to use the TZ environment variable to set the time zone for a shell account.
By default, the Linux shell uses the host server's time zone. If you are located in a different time zone, you can change this setting by using the TZ environment variable.
The TZ environment variable affects file and directory timestamps, as well as output from the date command. The following example shows how to set the time zone for California using the TZ environment variable:
export TZ="/usr/share/zoneinfo/America/Los_Angeles"
To make the setting take effect for subsequent logins, you can add this line to the ~/.bash_profile file or ~/.bashrc file.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.