Installing Oracle® Solaris 11.2 Systems

Exit Print View

Updated: July 2014
 
 

Setting the Time Zone and Locale

Use the sysconfig create-profile command with the location grouping to generate a valid profile that configures the time zone and locale.

# sysconfig create-profile -g location -o sc_location.xml

The svc:/system/timezone SMF service sets the time zone for the system.

The timezone property group contains the properties listed in the following table.

Table 11-4  timezone Property Group Properties
Property
Type
Required
Description
localtime
astring
optional
System time zone. The default is UTC.
Example 11-5  Configuring the Time Zone

This example sets the time zone to Central European Time/Prague, CZ.

<service name='system/timezone' version='1'>
  <instance name='default' enabled='true'>
    <property_group name='timezone'>
      <propval name='localtime' value='Europe/Prague'/>
    </property_group>
  </instance>
</service>

The svc:/system/environment:init SMF service sets the locale for the system.

The environment property group can define the following environment variables. See the environ(5) man page for information about environment variables.

Table 11-5  environment Property Group Properties
Environment Variable
Type
Required
Default Value
LC_CTYPE
astring
optional
C
LC_NUMERIC
astring
optional
C
LC_TIME
astring
optional
C
LC_COLLATE
astring
optional
C
LC_MONETARY
astring
optional
C
LC_MESSAGES
astring
optional
C
LC_ALL
astring
optional
C
LANG
astring
optional
C
Example 11-6  Configuring the Locale

This example sets the locale to Czech language (cs) and Czech Republic (CZ).

<service name='system/environment' version='1'>
  <instance name='init' enabled='true'>
    <property_group name='environment'>
      <propval name='LC_ALL' value='cs_CZ.UTF-8'/>
    </property_group>
  </instance>
</service>