Monday, February 14, 2011

HOWTO change timezone on Solaris 10 - x86

First of all, check your current timezone:

root@anneke $: date
Mon Feb 14 13:13:20 CST 2011
root@anneke $: grep -i tz /etc/TIMEZONE
# TZ, LANG, CMASK, or any of the LC_* environment variables.
root@anneke $:

If you still want to change your server timezone proceed as follow:
a) Edit /etc/TIMEZONE (NOTE: the man page incorrectly states this file is called /etc/timezone)
root@anneke $: vi /etc/TIMEZONE

# Examples:

For the full list, look in:
# /usr/share/lib/zoneinfo/

b) Reboot the system to effect the change
# [ "xxx" = `uname -n` ] && shutdown -rf now || echo "Wrong server" # (where xxx is the name of the server)

c) Verify the changes:
# date
# grep -i tz /etc/TIMEZONE