User your own timezone in Linux shell

Do you use a hosting provider that has a different timezone than you do? You can change the appearance of the timezone easily, without root access, or playing around with dates and times.

You can use the tzselect command. It will ask you for your Continent, your State/Province, and will output the command you need to modify your timezone.

I live in Brisbane, Australia, so my timezone is Australia/Brisbane. All I needed to do what append one line to my .bash_profile

echo “export TZ=Australia/Brisbane” >> .bash_profile

Now date returns the correct date and time, and all my files have local timestamps.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Anti Spam by WP-SpamShield