µMIC.200 –
How to adjust date and time
umic@uMIC:~$ timedatectl status
Local time: Mo 2018-08-13 16:20:00 CEST
Universal time: Mo 2018-08-13 14:20:00 UTC
RTC time:Mo 2018-08-13 14:20:00
Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: yes
systemd-timesyncd.service active: no
RTC in local TZ: no
Ausgabe der aktuellen Einstellungen
Be careful with when changing the time
A number of programmes react somewhat “allergic” if you want to change the time, such as Kerberos, Dovecot and database servers. If you have activated one of these applications, please close them before changing the time and then restart.
Be careful with when changing the time
The time zone can be set via the timedatectl set-timezone [ZONE] command. A list of time zones in Europe can be retrieved using the following command:
umic@uMIC:~$ timedatectl list-timezones | grep Europe
Europe/Amsterdam
Europe/Andorra
Europe/Astrakhan
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
..
Display time zones
Via the command timedatectl set-time [TIME] time and date can be set manually The parameter [TIME] is displayed in the following format “YYYY-MM-DD h:mm:ss”. In this example the time is set to the 1 January 2018, 12 o’clock. When executing the command the system will ask for the root password.
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-time ===
Authentication is necessary to set the system time.
Authenticating as: uMIC.200 User (umic)
Password:
==== AUTHENTICATION COMPLETE ===
Setting the time will automatically set the realtime clock.
umic@uMIC:~$ timedatectl status
Local time: Mo 2018-01-01 12:02:54 CET
Universal time: Mo 2018-01-01 11:02:54 UTC
RTC time: Mo 2018-01-01 11:02:54
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
Time check after setting
Automatic configuration
By using ntpd
date and system time can be set automatically. To do so, the parameters -g -q
have to be transferred, as otherwise the change of time will not be accepted.
umic@uMIC:~$ ntpd -g -q
1 Jan 12:10:13 ntpd[1831]: ntpd 4.2.8p10@1.3728-o (1): Starting
1 Jan 12:10:13 ntpd[1831]: Command line: ntpd -g -q
1 Jan 12:10:13 ntpd[1831]: proto: precision = 2.208 usec (-19)
1 Jan 12:10:13 ntpd[1831]: leapsecond file (‘/usr/share/zoneinfo/leap-seconds.list’): good hash signature
1 Jan 12:10:13 ntpd[1831]: leapsecond file (‘/usr/share/zoneinfo/leap-seconds.list’): loaded, expire=2018-12-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
..
13 Aug 17:15:46 ntpd[1831]: ntpd: time set +19368323.300651 s
ntpd: time set +19368323.300651s
The real time clock is not changed via this command.
umic@uMIC:~$ timedatectl status
Local time: Mo 2018-08-13 17:31:11 CEST
Universal time: Mo 2018-08-13 15:31:11 UTC
RTC time: Mo 2018-01-01 11:25:48
Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
How to set the realtime clock (RTC)
There are two realtime clocks on the µMIC.200. The first realtime clock (/dev/rtc0
) is provided be the processor and is not buffered. The second realtime clock (/dev/rtc1
) is buffered via capacitor. The realtime clock is accessed via the programme hwclock
which requires root
rights. Via the parameter -f
the realtime clock is selected, without this parameter the system will always access /dev/rtc0
.
umic@uMIC:~$ sudo hwclock -f /dev/rtc1
2018-08-13 15:44:15.790874+0200
Display of current time of the realtime clock
umic@uMIC:~$ sudo hwclock -w -f /dev/rtc1
Write the current system time into the realtime clock