One way to determine the local time zone is to run the following script:
tzselect
After answering a few questions about the location, the script will output the name of the time zone (e.g., Asia/Bangkok).
Then create the /etc/localtime
file by running:
sudo ln -sT /usr/share/zoneinfo/<xyz> /etc/localtime
Replace with the name of the time zone selected (e.g., Asia/Bangkok). In your specific case:
sudo ln -sT /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
It will change the timezone in your system wide (I mean for all users).
You can check that the new timezone is properly set automatically by running the command date
. For instance, I tested it right now and it returns
Sun Jul 24 13:26:51 ITC 2016
Also, as suggested from the tzselect
script output, you can make this change permanent for your user only by setting and exporting the TZ environment variable. To do that, you have to append the line TZ='Asia/Bangkok'; export TZ
to the end of the .profile
file in your home directory. You can run the command below to do that:
echo "TZ='Asia/Bangkok'; export TZ" >> $HOME/.profile
After that, you will need to log out of your current session and log back in for changes to take effect.
ntp
.23:16
there now. In is17:16
here in UK (London),16:16
UTC.