xref: /freebsd/usr.sbin/tzsetup/tzsetup.8 (revision c8b4c0aa6ca7e36fe401d14520557e0862603aab)
15a80fb27SWolfram Schneider.\" Copyright (c) 1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
25a80fb27SWolfram Schneider.\" All rights reserved.
38eeb71d7SWolfram Schneider.\"
45a80fb27SWolfram Schneider.\" Redistribution and use in source and binary forms, with or without
55a80fb27SWolfram Schneider.\" modification, are permitted provided that the following conditions
65a80fb27SWolfram Schneider.\" are met:
75a80fb27SWolfram Schneider.\" 1. Redistributions of source code must retain the above copyright
85a80fb27SWolfram Schneider.\"    notice, this list of conditions and the following disclaimer.
95a80fb27SWolfram Schneider.\" 2. Redistributions in binary form must reproduce the above copyright
105a80fb27SWolfram Schneider.\"    notice, this list of conditions and the following disclaimer in the
115a80fb27SWolfram Schneider.\"    documentation and/or other materials provided with the distribution.
128eeb71d7SWolfram Schneider.\"
135a80fb27SWolfram Schneider.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
145a80fb27SWolfram Schneider.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
155a80fb27SWolfram Schneider.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
165a80fb27SWolfram Schneider.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
175a80fb27SWolfram Schneider.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
185a80fb27SWolfram Schneider.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
195a80fb27SWolfram Schneider.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
205a80fb27SWolfram Schneider.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
215a80fb27SWolfram Schneider.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
225a80fb27SWolfram Schneider.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
235a80fb27SWolfram Schneider.\" SUCH DAMAGE.
245a80fb27SWolfram Schneider.\"
2597d92980SPeter Wemm.\" $FreeBSD$
2681046d3cSRuslan Ermilov.\"
2781046d3cSRuslan Ermilov.Dd October 21, 2009
288eeb71d7SWolfram Schneider.Dt TZSETUP 8
29a4c37c81SRuslan Ermilov.Os
308eeb71d7SWolfram Schneider.Sh NAME
318eeb71d7SWolfram Schneider.Nm tzsetup
328eeb71d7SWolfram Schneider.Nd set local timezone
33342afc34SPhilippe Charnier.Sh SYNOPSIS
34e97407b4SRuslan Ermilov.Nm
35ada5f18aSEdwin Groothuis.Op Fl nrs
3681046d3cSRuslan Ermilov.Op Fl C Ar chroot_directory
3781046d3cSRuslan Ermilov.Op Ar zoneinfo_file | zoneinfo_name
38342afc34SPhilippe Charnier.Sh DESCRIPTION
39239e57d0SGarrett WollmanThe
40342afc34SPhilippe Charnier.Nm
41490d5836SPhilippe Charnierutility reads a database of timezone information and presents a menu
42239e57d0SGarrett Wollmanallowing the user to select a specific zone without knowing the details
4307bfccd7SRuslan Ermilovof the database layout.
4407bfccd7SRuslan ErmilovThe selected zone is installed as the system
45239e57d0SGarrett Wollmandefault zone.
46490d5836SPhilippe CharnierThe
47239e57d0SGarrett Wollman.Nm
48490d5836SPhilippe Charnierutility also determines whether any adjustment is necessary for systems where
49239e57d0SGarrett Wollmanthe hardware clock does not keep
50239e57d0SGarrett Wollman.Tn UTC .
51342afc34SPhilippe Charnier.Pp
52*c8b4c0aaSEd MasteThe following options are available:
53239e57d0SGarrett Wollman.Bl -tag -offset indent -width Fl
5481046d3cSRuslan Ermilov.It Fl C Ar chroot_directory
55b5f58d77SEdwin GroothuisOpen all files and directories relative to
5681046d3cSRuslan Ermilov.Ar chroot_directory .
57342afc34SPhilippe Charnier.It Fl n
58239e57d0SGarrett WollmanDo not create or copy files.
59ada5f18aSEdwin Groothuis.It Fl r
6081046d3cSRuslan ErmilovReinstall the zoneinfo file installed last time.
6181046d3cSRuslan ErmilovThe name is obtained from
62ada5f18aSEdwin Groothuis.Pa /var/db/zoneinfo .
635d279e65SAttilio Rao.It Fl s
645d279e65SAttilio RaoSkip the initial question about adjusting the clock if not set to
655d279e65SAttilio Rao.Tn UTC .
66342afc34SPhilippe Charnier.El
67239e57d0SGarrett Wollman.Pp
68b8926904SEdwin GroothuisIt is possible to short-circuit the menu system by specifying the
69b8926904SEdwin Groothuislocation of a
7081046d3cSRuslan Ermilov.Ar zoneinfo_file
71b5f58d77SEdwin Groothuisor the name of the
7281046d3cSRuslan Ermilov.Ar zoneinfo_name
73b8926904SEdwin Groothuison the command line; this is intended mainly for pre-configured installation
74b5f58d77SEdwin Groothuisscripts or people who know which zoneinfo they want to install.
75239e57d0SGarrett Wollman.Sh TIMEZONE DATABASE
76239e57d0SGarrett WollmanThe contents of the timezone database are indexed by
77239e57d0SGarrett Wollman.Pa /usr/share/zoneinfo/zone.tab .
78239e57d0SGarrett WollmanThis file lists, for each timezone data file, the
79239e57d0SGarrett Wollman.Tn ISO
80239e57d0SGarrett Wollman3166 territory code, approximate geographical coordinates
81c4d9468eSRuslan Ermilov(in
82c4d9468eSRuslan Ermilov.Tn ISO
83c4d9468eSRuslan Ermilov6709 format),
84239e57d0SGarrett Wollmanand location within the territory.
85239e57d0SGarrett Wollman.Pp
86239e57d0SGarrett WollmanThe maintainers of the database maintain the following policies:
87239e57d0SGarrett Wollman.Bl -enum -offset indent
88239e57d0SGarrett Wollman.It
89239e57d0SGarrett WollmanAt least one zone for every country or inhabited geographical territory.
90239e57d0SGarrett Wollman.It
91239e57d0SGarrett WollmanOne zone for every distinct, documented timezone history since the
92239e57d0SGarrett Wollmanbeginning of the
93239e57d0SGarrett Wollman.Ux
94239e57d0SGarrett Wollmanepoch (January 1, 1970,
95239e57d0SGarrett Wollman.Tn GMT ) .
96239e57d0SGarrett Wollman.It
9707bfccd7SRuslan ErmilovEach zone is named for the most populous city therein.
9807bfccd7SRuslan Ermilov(Where possible,
99239e57d0SGarrett Wollmanthe database includes pre-1970 history for its city.)
100239e57d0SGarrett Wollman.El
101239e57d0SGarrett WollmanThe source code to the database
102239e57d0SGarrett Wollman.Pq Pa /usr/src/share/zoneinfo/[a-z]*
103239e57d0SGarrett Wollmancontains many additional comments and documentation references for the
104239e57d0SGarrett Wollmanhistorically minded.
1058eeb71d7SWolfram Schneider.Sh FILES
10681046d3cSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/zoneinfo/zone.tab" -compact
1078eeb71d7SWolfram Schneider.It Pa /etc/localtime
10881046d3cSRuslan Ermilovcurrent time zone file
1098eeb71d7SWolfram Schneider.It Pa /etc/wall_cmos_clock
110342afc34SPhilippe Charniersee
11181046d3cSRuslan Ermilov.Xr adjkerntz 8
112239e57d0SGarrett Wollman.It Pa /usr/share/misc/iso3166
113239e57d0SGarrett Wollmanmapping of
114239e57d0SGarrett Wollman.Tn ISO
11581046d3cSRuslan Ermilov3166 territory codes to names
116239e57d0SGarrett Wollman.It Pa /usr/share/zoneinfo
11781046d3cSRuslan Ermilovdirectory for zoneinfo files
118239e57d0SGarrett Wollman.It Pa /usr/share/zoneinfo/zone.tab
11981046d3cSRuslan Ermilovmapping of timezone file to country and location
120ada5f18aSEdwin Groothuis.It Pa /var/db/zoneinfo
12181046d3cSRuslan Ermilovsaved name of the timezone file installed last
1228eeb71d7SWolfram Schneider.El
123b5f58d77SEdwin Groothuis.Sh EXAMPLES
124b5f58d77SEdwin GroothuisNormal usage, to select the right zoneinfo file via the dialog-based
125b5f58d77SEdwin Groothuisuser interface:
12681046d3cSRuslan Ermilov.Dl tzsetup
12781046d3cSRuslan Ermilov.Pp
128b5f58d77SEdwin GroothuisInstall the file
129b5f58d77SEdwin Groothuis.Pa /usr/share/zoneinfo/Australia/Sydney :
13081046d3cSRuslan Ermilov.Dl "tzsetup /usr/share/zoneinfo/Australia/Sydney"
13181046d3cSRuslan Ermilov.Pp
132b5f58d77SEdwin GroothuisInstall the zoneinfo file for Australia/Sydney, assumed to be located
133b5f58d77SEdwin Groothuisin
134b5f58d77SEdwin Groothuis.Pa /usr/share/zoneinfo :
13581046d3cSRuslan Ermilov.Dl "tzsetup Australia/Sydney"
13681046d3cSRuslan Ermilov.Pp
137b5f58d77SEdwin GroothuisAfter a reinstall of the zoneinfo files, you can reinstall the
13881046d3cSRuslan Ermilovlatest installed zoneinfo file (as specified in
13981046d3cSRuslan Ermilov.Pa /var/db/zoneinfo ) :
14081046d3cSRuslan Ermilov.Dl "tzsetup -r"
1418eeb71d7SWolfram Schneider.Sh SEE ALSO
142bfd34a4aSWolfram Schneider.Xr date 1 ,
1438eeb71d7SWolfram Schneider.Xr adjtime 2 ,
1448eeb71d7SWolfram Schneider.Xr ctime 3 ,
1458eeb71d7SWolfram Schneider.Xr timezone 3 ,
1468eeb71d7SWolfram Schneider.Xr tzfile 5 ,
147bfd34a4aSWolfram Schneider.Xr adjkerntz 8 ,
1488eeb71d7SWolfram Schneider.Xr zdump 8 ,
149bb897a87SPhilippe Charnier.Xr zic 8
150239e57d0SGarrett Wollman.Sh DISCLAIMER
151239e57d0SGarrett WollmanThe representation of certain localities as being associated with certain
152239e57d0SGarrett Wollmancountries and/or territories is for the purposes of identification only,
153239e57d0SGarrett Wollmanand does not imply any endorsement or rejection on the part of the
154b5c508fbSRuslan Ermilov.Fx
155239e57d0SGarrett WollmanProject of the territorial claims of any entity.
15659a3c79dSRuslan Ermilov.Sh BUGS
15759a3c79dSRuslan ErmilovPrograms which are already running when
15859a3c79dSRuslan Ermilov.Nm
15959a3c79dSRuslan Ermilovcreates or updates
16059a3c79dSRuslan Ermilov.Pa /etc/localtime
16159a3c79dSRuslan Ermilovwill not reflect the updated timezone.
16259a3c79dSRuslan ErmilovWhen the system is first configured for a
16359a3c79dSRuslan Ermilov.Pf non- Tn UTC
16459a3c79dSRuslan Ermilovhardware clock, it is necessary to run
16559a3c79dSRuslan Ermilov.Xr adjkerntz 8
16659a3c79dSRuslan Ermilov(which normally happens as a part of system startup) in order to update
16759a3c79dSRuslan Ermilovthe kernel's idea of the correct timezone offset.
168