Friday, June 24, 2011

Ubuntu - set Server time to UTC

Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime

OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime

OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

No comments: