Gentoo Archives: gentoo-amd64

From: Dale <rdalek1967@×××××.com>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Re: Wrong time after move to new timezone
Date: Thu, 07 Jan 2016 06:55:38
Message-Id: 568E0BE3.4090204@gmail.com
In Reply to: [gentoo-amd64] Re: Wrong time after move to new timezone by Duncan <1i5t5.duncan@cox.net>
1 Duncan wrote:
2 > Mark Knecht posted on Wed, 06 Jan 2016 07:38:15 -0800 as excerpted:
3 >
4 >> The solution to this is eluding me. What changes, other than changing
5 >> /etc/timezone, are required to get a Gentoo machine to recognize that it
6 >> has moved physically and is living in a new timezone?
7 >>
8 >> I've just moved from Silicon Valley to Tucson, AZ. The machine came up
9 >> fine other than time being off by 1 hour which I expected. I changed
10 >> /etc/timezone from America/Los_Angeles to America/Phoenix and rebooted
11 >> and yet time is still showing California time.
12 >>
13 >> The system clock is UTC. [snipped]
14 > Welcome to AZ. I'm in Phoenix. Talking about time, the really nice
15 > thing about AZ is that it doesn't do daylight savings time, so you don't
16 > have to worry about time jumping around twice a year. =:^)
17 >
18 > I first read your message this AM, before work, but while I remembered
19 > that there was another file to configure, I forgot what it was, and
20 > didn't have time to look it up, so it had to wait until tonite.
21 >
22 > So I just looked it up in the handbook, and thus can point you right at
23 > it. =:^)
24 >
25 > https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Timezone
26 >
27 > You did the first part of it, setting /etc/timezone, but didn't do the
28 > second part, setting /etc/localtime, which is used by glibc to know your
29 > timezone. You can either do it using the command in the handbook:
30 >
31 > emerge --config sys-libs/timezone-data
32 >
33 > ... or you can do it manually by copying the appropriate timezone file
34 > from /usr/share/zoneinfo/ to /etc/localtime, for AZ:
35 >
36 > cp /usr/share/zoneinfo/America/Phoenix /etc/localtime
37 >
38 > (Every time you update the timezone-data package, its pkg_postinst() runs
39 > pkg_config(), which is what that emerge call does semi-manually, above.
40 > pkg_config in turn copies the appropriate file to /etc/localtime based
41 > on /etc/timezone, thus updating /etc/localtime with the timezone file
42 > from the freshly installed timezone-data package. The cp alternative
43 > simply does that same cp manually. You can of course take a look at the
44 > timezone-data ebuild itself to see exactly how it does it, if you like.
45 > It does get slightly fancier with its logic, setting factory if the
46 > timezone is invalid, not touching the localtime file if it's a symlink
47 > instead of an actual file, etc, but basically, just does the above under
48 > normal circumstances. =:^)
49 >
50
51
52 It's been a long time since I did this but isn't that supposed to be a
53 link instead of a copy? I'm pretty sure it was a link long ago but they
54 may have changed it.
55
56 Just to be sure.
57
58 Dale
59
60 :-) :-)

Replies

Subject Author
[gentoo-amd64] Re: Wrong time after move to new timezone Duncan <1i5t5.duncan@×××.net>