Time

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Table of Contents

Hardware clock

Set the BIOS / EUFI time to UTC time.
Use command hwclock (see man page) to adjust the hardware (bios/eufi) clock from a running linux installation.

On Gentoo:

/etc/init.d/hwclock
/etc/conf.d/hwclock

On Ubuntu and derivatives:
/etc/default/rcS 
UTC=yes

// Show hardware time:
# hwclock
2018-03-01 02:09:17.796233+0000
// Show system time:
# date
Thu Mar  1 02:09:37 -00 2018
// Set hardware clock to proper UTC time:
# hwclock --set --date "03/01/2018 02:03:00"
// Copy hardware time to system time:
# hwclock -s

Note that the hardware clock must be set to UTC time. To ensure that it is, you can run the debug information:

# hwclock --debug
hwclock from util-linux 2.30.2
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2018/03/29 23:56:17
Hw clock time : 2018/03/29 23:56:17 = 1522367777 seconds since 1969
Time since last adjustment is 1522367777 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2018-03-30 07:56:16.530824+0800

Compare the time given in the output to your local time to ensure that it is.

Timezone

List of timezones:
/usr/share/zoneinfo/

For any user, set the TZ variable to configure the timezone, e.g.:

# date
Tue Mar  6 00:41:06 -00 2018
# export TZ=Asia/Taipei
# date
Tue Mar  6 08:41:10 CST 2018

For the system timezone,
link /etc/localtime to the proper file within /usr/share/zoneinfo/
or use the usually accepted way to update the system timezone for your distro, e.g.:
https://wiki.gentoo.org/wiki/System_time

See also