xref: /freebsd/usr.sbin/tzsetup/tzsetup.8 (revision aa0a1e58)
1.\" Copyright (c) 1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.Dd July 4, 2009
27.Dt TZSETUP 8
28.Os
29.Sh NAME
30.Nm tzsetup
31.Nd set local timezone
32.Sh SYNOPSIS
33.Nm
34.Op Fl nrs
35.Op Fl C Ar chroot directory
36.Op Ar zoneinfo file | zoneinfo name
37.Sh DESCRIPTION
38The
39.Nm
40utility reads a database of timezone information and presents a menu
41allowing the user to select a specific zone without knowing the details
42of the database layout.
43The selected zone is installed as the system
44default zone.
45The
46.Nm
47utility also determines whether any adjustment is necessary for systems where
48the hardware clock does not keep
49.Tn UTC .
50.Pp
51The following option is available:
52.Bl -tag -offset indent -width Fl
53.It Fl C Ar chroot directory
54Open all files and directories relative to
55.Ar chroot directory .
56.It Fl n
57Do not create or copy files.
58.It Fl r
59Reinstall the zoneinfo file installed last time. The name is obtained from
60.Pa /var/db/zoneinfo .
61.It Fl s
62Skip the initial question about adjusting the clock if not set to
63.Tn UTC .
64.El
65.Pp
66It is possible to short-circuit the menu system by specifying the
67location of a
68.Ar zoneinfo file
69or the name of the
70.Ar zoneinfo name
71on the command line; this is intended mainly for pre-configured installation
72scripts or people who know which zoneinfo they want to install.
73.Sh TIMEZONE DATABASE
74The contents of the timezone database are indexed by
75.Pa /usr/share/zoneinfo/zone.tab .
76This file lists, for each timezone data file, the
77.Tn ISO
783166 territory code, approximate geographical coordinates
79(in
80.Tn ISO
816709 format),
82and location within the territory.
83.Pp
84The maintainers of the database maintain the following policies:
85.Bl -enum -offset indent
86.It
87At least one zone for every country or inhabited geographical territory.
88.It
89One zone for every distinct, documented timezone history since the
90beginning of the
91.Ux
92epoch (January 1, 1970,
93.Tn GMT ) .
94.It
95Each zone is named for the most populous city therein.
96(Where possible,
97the database includes pre-1970 history for its city.)
98.El
99The source code to the database
100.Pq Pa /usr/src/share/zoneinfo/[a-z]*
101contains many additional comments and documentation references for the
102historically minded.
103.Sh FILES
104.Bl -tag -width /usr/share/zoneinfo/zone.tab -compact
105.It Pa /etc/localtime
106current time zone file.
107.It Pa /etc/wall_cmos_clock
108see
109.Xr adjkerntz 8 .
110.It Pa /usr/share/misc/iso3166
111mapping of
112.Tn ISO
1133166 territory codes to names.
114.It Pa /usr/share/zoneinfo
115directory for zoneinfo files.
116.It Pa /usr/share/zoneinfo/zone.tab
117mapping of timezone file to country and location.
118.It Pa /var/db/zoneinfo
119saved name of the timezone file installed last.
120.El
121.Sh EXAMPLES
122Normal usage, to select the right zoneinfo file via the dialog-based
123user interface:
124.Dl # tzsetup
125Install the file
126.Pa /usr/share/zoneinfo/Australia/Sydney :
127.Dl # tzsetup /usr/share/zoneinfo/Australia/Sydney
128Install the zoneinfo file for Australia/Sydney, assumed to be located
129in
130.Pa /usr/share/zoneinfo :
131.Dl # tzsetup Australia/Sydney
132After a reinstall of the zoneinfo files, you can reinstall the
133latest installed zoneinfo file: (as specified in
134.Pa /var/db/zoneinfo )
135.Dl # tzsetup -r
136.Sh SEE ALSO
137.Xr date 1 ,
138.Xr adjtime 2 ,
139.Xr ctime 3 ,
140.Xr timezone 3 ,
141.Xr tzfile 5 ,
142.Xr adjkerntz 8 ,
143.Xr zdump 8 ,
144.Xr zic 8
145.Sh DISCLAIMER
146The representation of certain localities as being associated with certain
147countries and/or territories is for the purposes of identification only,
148and does not imply any endorsement or rejection on the part of the
149.Fx
150Project of the territorial claims of any entity.
151.Sh BUGS
152Programs which are already running when
153.Nm
154creates or updates
155.Pa /etc/localtime
156will not reflect the updated timezone.
157When the system is first configured for a
158.Pf non- Tn UTC
159hardware clock, it is necessary to run
160.Xr adjkerntz 8
161(which normally happens as a part of system startup) in order to update
162the kernel's idea of the correct timezone offset.
163