I'm a new user of GCE instances.
I created instances a week ago and changed timezone to Asia/Shanghai by commands below: cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Then yesterday, I found that my system timezone changed to UTC automatically and /etc/localtime was changed. So I run the command above agina. Until now it's OK.
After that I checked many resources and export TZ='Asia/Shanghai'. But I still not know if it's the root cause or not.
Also I find that someone adds xen.independent_wallclock=1 in sysctl.conf file to maintain independent times. But it's for Xen VM and I'm not sure if it's useful for GCE.
Could anyone please take a look at it ?
I've found a more user friendly approach here
Go root user
sudo -s
and use
dpkg-reconfigure tzdata
This will bring up a GUI which will guide you to change your timezone information
To make the permanent change edit $HOME/.profile or $HOME/.bash_profile appending the line and then log out and log in again:
TZ='Asia/Shanghai'; export TZ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With