xref: /freebsd/usr.sbin/tzsetup/tzsetup.8 (revision 297a9e552b9a5adf07d195eae9649b0758f395af)
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.Dd June 14, 2024
26.Dt TZSETUP 8
27.Os
28.Sh NAME
29.Nm tzsetup
30.Nd set local timezone
31.Sh SYNOPSIS
32.Nm
33.Op Fl nrs
34.Op Fl C Ar chroot_directory
35.Op Ar zoneinfo_file | zoneinfo_name
36.Sh DESCRIPTION
37The
38.Nm
39utility reads a database of timezone information and presents a menu
40allowing the user to select a specific zone without knowing the details
41of the database layout.
42The selected zone is installed as the system
43default zone.
44The
45.Nm
46utility also determines whether any adjustment is necessary for systems where
47the hardware clock does not keep UTC.
48.Pp
49The following options are available:
50.Bl -tag -offset indent -width Fl
51.It Fl C Ar chroot_directory
52Open all files and directories relative to
53.Ar chroot_directory .
54.It Fl n
55Do not create or symlink files.
56.It Fl r
57Reinstall the zoneinfo file installed last time.
58The name is obtained from
59.Pa /var/db/zoneinfo .
60.It Fl s
61Skip the initial question about adjusting the clock if not set to UTC.
62.Nm
63will neither create nor delete
64.Pa /etc/wall_cmos_clock .
65On a newly installed system, the hardware clock will keep UTC.
66.El
67.Pp
68It is possible to short-circuit the menu system by specifying the
69location of a
70.Ar zoneinfo_file
71or the name of the
72.Ar zoneinfo_name
73on the command line; this is intended mainly for pre-configured installation
74scripts or people who know which zoneinfo they want to install.
75.Sh TIMEZONE DATABASE
76The contents of the timezone database are indexed by
77.Pa /usr/share/zoneinfo/zone1970.tab .
78This file lists, for each timezone data file, the ISO 3166 territory code,
79approximate geographical coordinates (in ISO 6709 format),
80and location within the territory.
81.Pp
82The maintainers of the database maintain the following policies:
83.Bl -enum -offset indent
84.It
85At least one zone for every country or inhabited geographical territory.
86.It
87One zone for every distinct, documented timezone history since the
88beginning of the
89.Ux
90epoch (January 1, 1970, GMT).
91.It
92Each zone is named for the most populous city therein.
93(Where possible,
94the database includes pre-1970 history for its city.)
95.El
96.Pp
97The source code to the database
98.Pq Pa /usr/src/contrib/tzdata/[a-z]*
99contains many additional comments and documentation references for the
100historically minded.
101.Sh FILES
102.Bl -tag -width ".Pa /usr/share/zoneinfo/zone1970.tab" -compact
103.It Pa /etc/localtime
104current time zone file
105.It Pa /etc/wall_cmos_clock
106see
107.Xr adjkerntz 8
108.It Pa /usr/share/misc/iso3166
109mapping of ISO 3166 territory codes to names
110.It Pa /usr/share/zoneinfo
111directory for zoneinfo files
112.It Pa /usr/share/zoneinfo/zone1970.tab
113mapping of timezone file to country and location
114.It Pa /var/db/zoneinfo
115saved name of the timezone file installed last
116.El
117.Sh EXAMPLES
118Normal usage, to select the right zoneinfo file via the dialog-based
119user interface:
120.Pp
121.Dl # tzsetup
122.Pp
123Install the file
124.Pa /usr/share/zoneinfo/Australia/Sydney :
125.Pp
126.Dl "# tzsetup /usr/share/zoneinfo/Australia/Sydney"
127.Pp
128Install the zoneinfo file for Australia/Sydney, assumed to be located in
129.Pa /usr/share/zoneinfo :
130.Pp
131.Dl "# tzsetup Australia/Sydney"
132.Pp
133After a reinstall of the zoneinfo files, you can reinstall the
134latest installed zoneinfo file (as specified in
135.Pa /var/db/zoneinfo ) :
136.Pp
137.Dl "# tzsetup -r"
138.Sh SEE ALSO
139.Xr date 1 ,
140.Xr adjtime 2 ,
141.Xr ctime 3 ,
142.Xr timezone 3 ,
143.Xr tzfile 5 ,
144.Xr adjkerntz 8 ,
145.Xr zdump 8 ,
146.Xr zic 8
147.Sh DISCLAIMER
148The representation of certain localities as being associated with certain
149countries and/or territories is for the purposes of identification only,
150and does not imply any endorsement or rejection on the part of the
151.Fx
152Project of the territorial claims of any entity.
153.Sh BUGS
154Programs which are already running when
155.Nm
156creates or updates
157.Pa /etc/localtime
158will not reflect the updated timezone.
159When the system is first configured for a non-UTC
160hardware clock, it is necessary to run
161.Xr adjkerntz 8
162(which normally happens as a part of system startup) in order to update
163the kernel's idea of the correct timezone offset.
164