|
 |

|
Changing Time Zones and Local Time
The following procedure should be used to change
the Solaris 2.x system clock to agree with the local time and
local time zone.
The example will assume that the system clock is
already set to Pacific Standard Time and will be changed to Eastern
Standard Time.
- Determine the local time zone. A world atlas
should help.
Example: using Eastern Time
in the United States
- Determine the file in the '
/usr/share/lib/zoneinfo'
that describes the local time zone found in 1. above. You can
list the subdirectories and files in this directory with the command:
% ls -RFx /usr/share/lib/zoneinfo
Example: use the file 'US/Eastern'
- Change the TZ environment variable that is set
during the boot process. This variable is set in the file
'/etc/default/init'. You must have root permissions to change
this file.
% su
# /usr/openwin/bin/textedit
/etc/default/init
Change the last line in this file to include the file found in 2. above.
Save the edit changes and quit the Text Editor.
Example: the last line now reads: "TZ=US/Eastern"
- Reboot the system to propagate the new time zone.
# reboot
- Verify that the time zone changes made in 3. above have taken
effect.
- Look at the clock in the upper left hand corner
of the screen. You should see the correct time zone.
Example: the time zone should read "US/Eastern"
- From an xterm window, give the 'date' command.
The 3 letter time zone abbreviation should appear.
Example: %
date
Wed Aug 21 10:21:45 EST 1996
The 'EST' is the abbreviation for Eastern Standard Time
Determine the current local time. You may need
to refer to the world time zone chart to calculate how many hours
to add or subtract from Pacific time.
Example: Eastern time
(-5 hours from Greenwich Meantime) is three hours ahead of Pacific
time (-8 hours from GMT). Therefore, you would add three hours
to Pacific time to determine Eastern time
NOTE: If the time printed in 5. above is correct,
you may stop here after you run an application (e.g. Random) and
note the proper time and time zone in the Status window of the
Test Display.
Example: 21-Aug-1996 13:21:45
Set the current local time in the system clock.
% su
# date mmddHHMMccyy
where:
- mm is the month (01=January, ..., 12=December)
- dd is the day of the month (01, 02, ..., 28, 29,
30, 31)
- HH is the hours in the 24-hour clock (00=midnight,
01=1AM, ..., 12=noon, 13=1PM, ..., 23=11PM)
- MM is the minutes (00, 01, ..., 58, 59)
- cc is the century minus 1 (19=20th century, 20=21st century)
- yy are the last two digits of the year.
Reboot the system
# reboot
Verify that the current local time and time zone
are correct.
- Look at the clock in the upper left hand corner
of the screen. You should see the correct current local time
and time zone.
Example: "13:21 08/21/96 US/Eastern"
- From an xterm window, give the 'date' command.
The correct current local time and time zone abbreviation should
appear.
Example:% date
Wed Aug 21 13:21:45 EST 1996
The 'EST' is the abbreviation for Eastern Standard Time
- Run an application (e.g. Random) and note the
proper time zone in the Status window of the Test Display.
Example: 21-Aug-1996 13:21:45
|
|