I'm confused: what is the right way to change TZ on a freshly installed Solaris 11.2?
I have found these, but am unsure which to use:
I'm confused: what is the right way to change TZ on a freshly installed Solaris 11.2?
I have found these, but am unsure which to use:
To answer your question, use the instructions in the second link, summarized here. This will change the system-wide default timezone for libraries and utilities that print or return the time. It will not affect the actual contents of the real-time clock in the hardware (or virtual machine host infrastructure for a VM). The rtc command is used to configure the actual time stored in the hardware. You need to worry about that if you're going to be frequently rebooting from Solaris into Windows on the same hardware and you need to make sure they both understand the time value that's stored in the hardware realtime lock chip.
In Solaris 11.2 you can use the nlsadm utility to set this.
# date Tuesday, December 15, 2015 08:54:04 PM UTC # nlsadm get-timezone timezone=UTC # nlsadm list-timezone | grep US/Pacific US/Pacific # nlsadm set-timezone US/Pacific Reading IPS package information ... Setting SMF property timezone/localtime with value: 'US/Pacific' ... Successfully set # date Tuesday, December 15, 2015 12:54:24 PM PST You may need to install the nls-administration package using
# pkg install nls-administration There is a man page for the nlsadm utility which is installed with the binary. Here is a link to the documentation describing the process.
http://docs.oracle.com/cd/E36784_01/html/E39134/gllkr.html
Under the covers, the nlsadm utility will use the svccfg commands described in an earlier answer. And under those covers there is a symlink in /etc for backwards compatibility. That's right, it's just covers all the way down. :-)
nlsadm list-timezone to view timezones that you can pick from. You should use TZ=localtime on Solaris 11. It is a symbolic link to actual timezone file, but it allows to switch timezones without restarting processes.
This symlink is created by svc:/system/timezone:default SMF service, so simply update its configuration:
# svccfg -s timezone:default svc:/system/timezone:default> setprop timezone/localtime = Europe/Moscow svc:/system/timezone:default> end # svcadm refresh timezone nlsadm can also be used to set the timezone, along with other locale specifics such as language and keyboard.
Look for the timezone:
solaris11 [8]# nlsadm list-timezone | grep -i <TIME_ZONE>
Set the timezone:
solaris11 [9]# nlsadm set-timezone <TIME_ZONE>