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. 66This option is enabled automatically on non-x86 hardware. 67.El 68.Pp 69It is possible to short-circuit the menu system by specifying the 70location of a 71.Ar zoneinfo_file 72or the name of the 73.Ar zoneinfo_name 74on the command line; this is intended mainly for pre-configured installation 75scripts or people who know which zoneinfo they want to install. 76.Sh TIMEZONE DATABASE 77The contents of the timezone database are indexed by 78.Pa /usr/share/zoneinfo/zone1970.tab . 79This file lists, for each timezone data file, the ISO 3166 territory code, 80approximate geographical coordinates (in ISO 6709 format), 81and location within the territory. 82.Pp 83The maintainers of the database maintain the following policies: 84.Bl -enum -offset indent 85.It 86At least one zone for every country or inhabited geographical territory. 87.It 88One zone for every distinct, documented timezone history since the 89beginning of the 90.Ux 91epoch (January 1, 1970, GMT). 92.It 93Each zone is named for the most populous city therein. 94(Where possible, 95the database includes pre-1970 history for its city.) 96.El 97.Pp 98The source code to the database 99.Pq Pa /usr/src/contrib/tzdata/[a-z]* 100contains many additional comments and documentation references for the 101historically minded. 102.Sh FILES 103.Bl -tag -width ".Pa /usr/share/zoneinfo/zone1970.tab" -compact 104.It Pa /etc/localtime 105current time zone file 106.It Pa /etc/wall_cmos_clock 107see 108.Xr adjkerntz 8 109.It Pa /usr/share/misc/iso3166 110mapping of ISO 3166 territory codes to names 111.It Pa /usr/share/zoneinfo 112directory for zoneinfo files 113.It Pa /usr/share/zoneinfo/zone1970.tab 114mapping of timezone file to country and location 115.It Pa /var/db/zoneinfo 116saved name of the timezone file installed last 117.El 118.Sh EXAMPLES 119Normal usage, to select the right zoneinfo file via the dialog-based 120user interface: 121.Pp 122.Dl # tzsetup 123.Pp 124Install the file 125.Pa /usr/share/zoneinfo/Australia/Sydney : 126.Pp 127.Dl "# tzsetup /usr/share/zoneinfo/Australia/Sydney" 128.Pp 129Install the zoneinfo file for Australia/Sydney, assumed to be located in 130.Pa /usr/share/zoneinfo : 131.Pp 132.Dl "# tzsetup Australia/Sydney" 133.Pp 134After a reinstall of the zoneinfo files, you can reinstall the 135latest installed zoneinfo file (as specified in 136.Pa /var/db/zoneinfo ) : 137.Pp 138.Dl "# tzsetup -r" 139.Sh SEE ALSO 140.Xr date 1 , 141.Xr adjtime 2 , 142.Xr ctime 3 , 143.Xr timezone 3 , 144.Xr tzfile 5 , 145.Xr adjkerntz 8 , 146.Xr zdump 8 , 147.Xr zic 8 148.Sh DISCLAIMER 149The representation of certain localities as being associated with certain 150countries and/or territories is for the purposes of identification only, 151and does not imply any endorsement or rejection on the part of the 152.Fx 153Project of the territorial claims of any entity. 154.Sh BUGS 155Programs which are already running when 156.Nm 157creates or updates 158.Pa /etc/localtime 159will not reflect the updated timezone. 160When the system is first configured for a non-UTC 161hardware clock, it is necessary to run 162.Xr adjkerntz 8 163(which normally happens as a part of system startup) in order to update 164the kernel's idea of the correct timezone offset. 165