D
D
Dmitry2014-02-16 14:37:20
linux
Dmitry, 2014-02-16 14:37:20

How to correctly set MSK time in Gentoo Linux?

I would like the community to take a "dump" of my thoughts on time and point out any errors in Linux time understanding or confirm.
In any modern Intel-compatible computer with a loaded gentoo minimal disk, there are two types of clocks: 1) Hardware and 2) System. The first type of clock can be changed using the date command, and the second by setting timezone-data and other configuration files, i.e. the first is built into the BIOS, and the second is generated by the Linux system based on the settings and value of the first clock type.
Installing Gentoo on a virtual machine under VmWare, before unpacking stage3, I made sure that my wristwatch and the result of the date command match, there was a UTC mark, but I didn’t look closely, it might have been UTC + 4 ... . Next, after unpacking stage3 and chroot /mnt/gentoo, I did:

# echo "Europe/Moscow" > /etc/timezone
# emerge --config sys-libs/timezone-data

PS: The time setting is taken from the Gentoo Handbook
My watch in Gentoo began to show 4 hours more than on the wrist. I have a feeling that the time that I first looked at before unpacking stage3 was set to UTC + 4 and I had to look in the Internet what GMT is now, i.e. UTC+0 and that's it and set using the date command. This is true?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2014-02-16
@EvilsInterrupt

In any modern Intel-compatible computer with a loaded gentoo minimal disk, there are two types of clocks: 1) Hardware and 2) System.

Yes.
No. The date command manipulates the system time. The hardware rtc is manipulated by the hwclock command. It, in particular, can synchronize the system time with rtc time and vice versa. timezone affects how time is presented to the user. The core always manipulates time without a timezone. Different processes on the same system can have different time zones:
$ date
Sun Feb 16 16:22:51 MSK 2014
$ TZ='CET' date
Sun Feb 16 13:23:20 CET 2014

It is common practice to keep the hardware clock set to UTC, although this is not required; You can configure the choice of UTC or local time in the /etc/adjtime.
A little more detail can be found in man hwclock
Almost. It is not built into the BIOS, it is a special hardware unit - the real time clock (rtc). linux initializes the system time at startup to rtc time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question