Questions tagged [clock]

Questions about the timekeeping mechanisms on Unix/Linux systems and/or interaction with the on-board hardware clock. Questions on the use of network time protocols should use the respective tags for those instead, unless they also involve the system's hardware clock. Not to be used for questions on the CPU's clock oscillator frequency (aka "overclocking").

Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

annoying clocksource alert/warning in bash prompt periodically

So I just build LFS system and it's working fine, but the annoying part is there's alert that every periode show like every 3 second. It said root@LFS:# clocksource: timekeeping watchdog on CPU0: ...
user avatar
1 vote
1 answer
39 views

Keep system clock synchronized to hardware clock

The situation: We have some Linux VMs running compute jobs. The VMs do not have Internet access (including NTP). The hypervisor does know the correct time. The hypervisor's time is exposed to the VM ...
user avatar
0 votes
2 answers
43 views

Xlib: what is the best implementation of GUI digital clock?

I am making an X application which contains a digital clock. The clock displays the current time in the format of "hh:mm". I want to master Xlib, so I want to use only Xlib (no other ...
user avatar
1 vote
3 answers
106 views

What config value should I set to make the HZ value (jiffies) physically correct?

When building linux kernel Image, we set the value HZ. linux kernel has the default HZ value. It is a software clock frequency the kernel operates at and 1/HZ (=jiffies) is the unit of scheduler ...
user avatar
  • 269
3 votes
1 answer
269 views

Check status of 11-Minute Kernel mode using adjtimex

I have a Debian Buster system which has the Kernel compiled without the CONFIG_RTC_SYSTOHC since I DO NOT want the 11-minute kernel mode to be on. However, I wanted to check if this change actually ...
user avatar
  • 75
1 vote
0 answers
105 views

Assertion 'clock_gettime(map_clock_id(clock_id), &ts) == 0' failed at ../src/basic/time-util.c:55, function now(). Aborting

As per this naswer I have tried to fix a failed libc6 and libcrypto update. I created a link where it seemed appropriate by mounting my SD card onto /media on another PC changed directory to /media/...
user avatar
  • 237
0 votes
0 answers
20 views

Clock_id of clock_gettime function in Ubuntu 20.04 LTS

I know that there are many clock_ids in clock_gettime function, for exmaple CLOCK_REALTIME and CLOCK_MONOTONIC. These clock_ids may be very accurate, even nanosecond level. My question is what kind of ...
user avatar
0 votes
0 answers
65 views

Running fake-hwclock every minute with crontab

I'm trying to run fake-hwclock every minute using crontab. I did: sudo crontab -e And added this line: * * * * * fake-hwclock To check if command is running I did: sudo grep -a "fake-hwclock&...
user avatar
0 votes
0 answers
36 views

PHC2Sys and syscalls with intel NIC have insane high latency

I'm currently working on a device wich is set to give out multiple different timing Protocolls from one PTP-grandmaster. For this i have an RockPro64 SOC with an Intel i350 NIC. For the Project I ...
user avatar
  • 1
0 votes
1 answer
199 views

Who sets date/time automatically from the hardware clock at boot?

When Linux is booting, the current time must be fetched from a RTC chip and then set to Linux system date/time. I can do this manually by running hwclock --hctosys. But where exactly does this happen ...
user avatar
  • 131
0 votes
1 answer
93 views

When is the system time synced to hardware clock?

Quoting from https://wiki.archlinux.org/title/System_time: Standard behavior of most operating systems is: Set the system clock from the hardware clock on boot. Keep accurate time of the system ...
user avatar
  • 753
1 vote
1 answer
276 views

Where does systemd get the build time in order to advance?

On bootup, systemd gives me System time before build time, advancing clock if the hardware clock is older than the build time. But where does it get this build time? It advances the time to 09/Sept/...
user avatar
  • 111
0 votes
1 answer
168 views

How to know when was the last time I changed the time zone?

I changed my time zone recently but can't recall which day. Is there a way to know what is the date that I changed my time zone?
user avatar
0 votes
1 answer
225 views

How can I verify the clocksource in my system?

According to the kernel code, timekeeping will initialize the clocksource as jiffies. /* * timekeeping_init - Initializes the clocksource and common timekeeping values */ void __init ...
user avatar
0 votes
0 answers
29 views

CentOS 7 Network drops after changing clock?

So I have a CentOS 7 desktop box that has been rock solid for a few years. However I noticed that my system clock is fast by about 7 or 8 minutes. NTP was not running. Every attempt to reset the ...
user avatar
2 votes
1 answer
59 views

How to know if the computer was started automatically by the BIOS

I configured my BIOS to turn on my computer automatically at a specific time each day. I would like to know of there is a way in Linux to check if the computer was turned on manually by a human or ...
user avatar
  • 148
5 votes
1 answer
406 views

How are time namespaces supposed to be used?

I thought I could do something like: sudo unshare -T bash -c 'date -s "$1" && foobar' sh "$(date -d -1day)" so foobar would see a different system time from the rest of ...
user avatar
  • 4,072
1 vote
0 answers
31 views

Hardware clock and date not aligned

On a Linux device I am using the hwclock command and the date command return different values: root@myhost:/home/user# hwclock 2021-04-08 15:12:55.878171+02:00 root@myhost:/home/user# date Thu 8 Apr ...
user avatar
  • 111
0 votes
0 answers
68 views

Why is my system clock absurdly wrong after reboot? [duplicate]

So I'm using a CentOS 8 system (just installed CentOS 8 minimal to reproduce on, so my application can't be an issue). If I turn off ntp, and set the time to several years ago, things are as expected. ...
user avatar
1 vote
1 answer
128 views

Is it possible to get the CPU time of any thread on Linux by calling clock_gettime?

If I know the TID of an arbitrary thread that is running on my system, I can easily compute its pthread cpu clock ID. But would I be able to call clock_gettime from my program and get its CPU time? My ...
user avatar
  • 121
2 votes
1 answer
145 views

How to configure openntpd to only rarely connect to NTP servers and sync the clock (or only when a large clock drift was detected)?

Because the clocks of multiple of my Debian/KDE machines went off by many minutes for no apparent reason and common mainboards (or at least the one that I have) don't have accurate, reliable hardware ...
user avatar
  • 3,430
0 votes
1 answer
19 views

Seed executables randomization outside of code

We have put in place a features test framework which consists in running our code against some third partie`s pre-existing software. We do so periodically and compare the results with expected results ...
user avatar
  • 101
1 vote
0 answers
139 views

Terminal 1 hour ahead of system time

My terminal is 1 hour in advance of the actual time (which is displayed correctly at the tray). The local time at the time of the command is actually 13:53, while UTC is 12:53 Im using ZSH on Manjaro: ...
user avatar
  • 111
0 votes
0 answers
21 views

programmatic control of application's perception of time

I'm looking to be able to control an application's perception of time from another process. Meaning I want to be able to fast-forward the clock. Whether by accelerating it, or stepping, either would ...
user avatar
  • 67.4k
0 votes
1 answer
368 views

Get system uptime with better precision then seconds

My system is running Linux for embedded. At the moment I didn't sync the system clock or gave the user an option to do it but it's going to change. Different parts in my application are using ...
user avatar
  • 13
0 votes
0 answers
43 views

My harware clock is OK, but the system clock is not, and I cannot set it [duplicate]

From Linux, the date --iso-8601=s command returns: 2020-10-23T22:26:22+01:00 The timezone is correct, the UTC offset is correct (England, daylight saving time). However the clock is one hour ahead. ...
user avatar
  • 449
2 votes
2 answers
441 views

Any way to make system time go slower or faster?

I'd like to make the system clock go slower or faster on Linux. On Windows, there's a very useful freeware called "Time Travel". To get an idea of what it does, just check this image, ...
user avatar
  • 21
2 votes
1 answer
8k views

My local time is in the correct timezone, but isn't actually the real local time here

I have a machine that dual boots Kali Linux and Windows. The correct local time when I ran my tests was 11:19 IST (India Standard Time), which is of course 05:49 UTC. As you can see from the edit ...
user avatar
  • 31
1 vote
1 answer
350 views

Negative time differences with `last reboot`

Looking at last reboot | head -3, I get the following result: reboot system boot 5.7.10-201.fc32. Fri Jul 31 11:29 still running reboot system boot 5.7.10-201.fc32. Fri Jul 31 11:22 - 09:29 (-...
user avatar
  • 156
2 votes
1 answer
346 views

Hardware timer , Real time clock, Jiffies in Linux context

I am trying to understand the Timer interrupts and the associated terms used in an x86_64 Linux machine. Hardware timer (External clock) is same as a Real Time Clock. The Real time clock runs even ...
user avatar
  • 113
3 votes
0 answers
150 views

XFCE- Small caps in Clock?

I am trying to make the month and day in my clock in XFCE be in small caps, because I like the look. To be clear, this is what I mean: The image above was achieved in LibreOffice using Linux ...
user avatar
1 vote
0 answers
423 views

Linux Time persist through reboot issue

I have a custom board that houses a System on module(SOM) running linux kernel 4.4.15 The board has an RTC that is backed up via small battery. I have the board running with no network connection ...
user avatar
  • 250
0 votes
2 answers
1k views

hwclock -r not working, but RTC seems ok

I have a Debian/Raspbian buster Linux on a Raspberry Pi 4 with isl1208 RTC attached. I think the RTC itself works: I can read it directly with a python script when kernel module disabled systemd ...
user avatar
3 votes
2 answers
100 views

Impact of missing real-time clock on linux services (esp. asterisk)

We're currently working on a new server, for an avionics system. This server normally uses Debian Stretch. But the hardware we use has no battery to save the clock. After reboot, the factory date/...
user avatar
  • 181
1 vote
0 answers
187 views

CPU MHz don't reach CPU min MHz in lscpu

I think CPU MHZ is always more than CPU min MHz. But, my server can't do that now. When it looks like below, what should I check? Architecture: x86_64 CPU op-mode(s): 32-bit, 64-...
user avatar
  • 11
0 votes
1 answer
56 views

Understanding linux clk_core clock topology

While reading linux driver-api/clk.html documentation, I found, that struct clk_core has pointers to struct clk_core *parent; I cannot understand, why tree topology is needed? Why just array ...
user avatar
0 votes
0 answers
168 views

faketime adjusting clock rate freezing graphical applications?

I am trying to trick Chromium to think time passes faster than it really does. One user suggested I use libfaketime. It works, almost. Specifying time shift works fine: faketime -f '+1y' chromium-...
user avatar
  • 141
2 votes
1 answer
1k views

Should I be seeing (non-VDSO) clock_gettime() syscalls on x86_64 using HPET?

While looking up how to use gettimeofday() for the umpteenth time I decided this time to do a quick dive on vDSO since I only had a vague awareness of it and wondered if there were any usage gotchas I ...
user avatar
  • 889
3 votes
1 answer
27k views

Set clock to 24 hour format for all users

On Fedora 30, I'm currently displaying the date in 24 hour format in the desktop environment. I'm syncing time via chronyd. But on the CLI, the time is displaying as Fri 22 Nov 2019 02:47:51 PM EST ...
user avatar
  • 1,500
2 votes
1 answer
745 views

why does NFS require synchronized system clocks?

In multiple tutorials abouts setting up NFS, there are recommendations about setting up NTP as well to avoid differences between the clocks of the different systems. Do clock drifts affect the file ...
user avatar
  • 183
9 votes
2 answers
2k views

How does Linux use a real time clock?

I'm investigating a very strange effect on some Beagle Bone Black (BBB) boards. We're seeing occasional jumps of a few months in the system clock which always correlate with systemd-timesyncd ...
user avatar
0 votes
1 answer
116 views

Does clock() return process or overall system clock count?

I'm trying to count the time it takes for a code segment to complete. But I'm not looking to determine the time it takes for the process to run, but rather the time it took all things considered, eg ...
user avatar
  • 121
0 votes
1 answer
2k views

Linux system-time differs from RTC time

I'm running Debian Stretch and Linux kernel version 4.9.110-3+deb9u4, with a modified config. I'm observing the following weird behaviour Set the hardware clock to 2016-01-01 00:00:00 UTC Reboot ...
user avatar
  • 721
1 vote
1 answer
6k views

Ubuntu NTP server: no server suitable for synchronization found

I am synchronizing 4 Raspberry Pi Clocks with an Ubuntu server (all in a local net, connected over ethernet), using NTP. All devices are offline, so the Server just listens to its local clock; The ...
user avatar
1 vote
1 answer
761 views

How to manually set CPU clock frequency in Fedora?

I have a first generation i7 computer and it is prone to overheating. How can I set the CPU clock frequency in Fedora?
user avatar
  • 180
-2 votes
1 answer
174 views

Prevent the debian installer from assuming that my RTC is using localtime

I've just installed a debian system, and just like the last time 10 years ago, it has b0rked my machine by assuming that my real time/hardware clock was using localtime, despite me not having told it ...
user avatar
0 votes
1 answer
214 views

Big clock on whole screen in centos-7

I was going to write command tmux detach but I accidentally pressed some other key/ key combinations and saw a big clock on the whole terminal. There was just time printed and nothing else. I don't ...
user avatar
3 votes
1 answer
136 views

Should I set the time in a container?

I have a few containers (systemd-nspawn based) and I am wondering whether I should set up the time (via systemd-timesyncd) or is it maintained by the host?
user avatar
  • 1,268
2 votes
1 answer
485 views

wrong time at Ubuntu 16.04.1 LTS

I have VM with Ubuntu 16.04.1 LTS, and time is wrong. The difference is about 15 hours. I synchronize it via sudo ntpdate 1.ro.pool.ntp.orgevery day and then it becomes right, but next day I have this ...
user avatar
  • 263
2 votes
1 answer
8k views

Chrony client do not change system and hardware date

Context Centos 7 chronyd (chrony) version 3.1 Issue I am encountering an issue with chonyd and server date. First, change current date to old date I changed the hardware clock date from the ...
user avatar
  • 233