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
2 answers
111 views

What is the command to change the 'System clock synchronized:' setting from 'no' to 'yes' in photon os

I have a VM running Photon OS 3.0. NTP is not configured and it is using the hardware clock. It has fallen out of sync. The hardware clock hwclock is in sync with the hypervisor time, but when I run ...
Anand's user avatar
  • 1
0 votes
0 answers
39 views

Bizarre system time drift when resuming from sleep

I recently purchased a HP 14-fq1003cl laptop and stripped it curse that is Windows 11 and put KDE neon on the system. It works very well with Linux and I am very pleased with it. However, one issue ...
Alek's user avatar
  • 1
-1 votes
1 answer
53 views

Dualboot | After synced time on windows linux time is wrong

After i synced the windows time my hardware clock time is bad. timedatectl Local time: Sun 2023-10-01 15:38:05 CEST Universal time: Sun 2023-10-01 13:38:05 UTC ...
Lolis4TheWin's user avatar
2 votes
1 answer
113 views

System time synchronization between two hosts using linuxPTP

I would like to setup a high-precision system time synchronization between two machines using linuxptp. On the first host: the system time is periodically synchronized using NTP using an interface ...
Emeric Verschuur's user avatar
2 votes
3 answers
306 views

For what do you need to change hardwareclock and how?

I started Linux server (Amazon Linux 2) from scratch. I'm in Tokyo locale and I changed timezone info like this; ll /etc/localtime # lrwxrwxrwx 1 root root 25 Feb 22 10:11 /etc/localtime -> ../usr/...
tom's user avatar
  • 23
0 votes
1 answer
638 views

How to set NTP synchronized to yes in Linux without NTP sync?

How to set NTPSynchronized to yes in Linux without actual NTP synchronization? I just want to cheat some program. ]$ timedatectl show -p NTPSynchronized NTPSynchronized=yes
Kirby Zhou's user avatar
0 votes
2 answers
93 views

RTC doesn't work

I have an embedded board (NanoPi R5C) with an RTC battery connector: On the board it's marked obvious which one is positive and negative. Moreover, checking the documentation: RTC backup current is ...
Daniel's user avatar
  • 339
0 votes
0 answers
130 views

Failed to unload kernel module: Resource temporarily unavailable

I am working on an embedded Linux (kernel-5.10.24). I hit an error when I tried to unload RTC driver module, it was: # lsmod rtc_test 6490 1 - Live 0xc02f5000 # modprobe -r rtc_test modprobe: remove '...
wangt13's user avatar
  • 377
1 vote
0 answers
114 views

Linux UTM VM Hardware Clock is Incorrect

My machine natively runs MacOS Ventura 13.3.1. I am using UTM to run 5.14.8-arch1-1. I am on PST. The output of sudo hwclock --verbose is as follows: hwclock from util-linux 2.37.2 ... Hardware clock ...
user129393192's user avatar
0 votes
1 answer
336 views

Is there a way for accurate timekeeping on Linux/Debian without NTP/Internet?

The only way I could get a working clock on Debian is by using NTP to sync the clock as described here. Is there a way to have a reliably accurate clock without NTP and without any Internet connection?...
mYnDstrEAm's user avatar
  • 4,147
0 votes
3 answers
5k views

Hardware and System clock both wrong in linux

I dual booted my laptop and installed EndeavourOS (while other OS being windows 10) Due to this, my hardware and system clock both show the wrong time. I have set the correct time zone (UTC+5:30), ...
V.G's user avatar
  • 117
0 votes
1 answer
136 views

How to fix Gnome Clock on Bar (date command seems to not use correct timezone)

Fedora 37 with Gnome Shell 43. On Status Bar on the top I see wrong time. But When I opening Gnome Clock app (this one https://wiki.gnome.org/Apps/Clocks) then I see correct time Also when I typing ...
Daniel's user avatar
  • 131
0 votes
0 answers
65 views

linux clock tree problems

Do have 2 board with slightly different hardware (same SoC). While kernel/uboot source are same, the dt slightly differs. But I don't touch the overall clock settings. Nevertheless what systems gives ...
Arno's user avatar
  • 115
0 votes
1 answer
220 views

terminal timer with end time given through bash

so I had the idea of making a bash function that takes in a time in hh:mm:ss (24 hour format) and makes a timer till that time kinda like a one time alarm while also showing how much time is left I ...
stacking and exchanging woohoo's user avatar
2 votes
2 answers
449 views

How can the time command compute one millisecond from 4 ms timer ticks?

From the bash time command on different stock Ubuntu systems (both real hardware and VMs) all with CONFIG_HZ=250, I'm sometimes getting real 0m0.001s, user 0m0.001s or sys 0m0.001s as well ...
Juergen's user avatar
  • 566
0 votes
1 answer
337 views

How to interpret the ptp4l statistics in the ouput?

I get the following output from the ptp4l command on slave PTP node. When I terminate it, some global statistics are printed out, but I cannot interpret the values, as I do not find any evident ...
AntVival's user avatar
5 votes
3 answers
3k views

System Clock vs. Hardware Clock (RTC) in embedded systems

The system clock is maintained by the kernel, whereas the hardware clock is maintained by the Real Time Clock (RTC). Do both clock run at same frequency? Are both independent of each other? What ...
Sukanya U's user avatar
0 votes
1 answer
828 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: ...
Muhammad Ikhwan Perwira's user avatar
1 vote
1 answer
1k 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 ...
Vladimir Panteleev's user avatar
0 votes
2 answers
279 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 ...
user356126's user avatar
1 vote
3 answers
2k 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 ...
Chan Kim's user avatar
  • 367
3 votes
1 answer
713 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 ...
Harsh's user avatar
  • 121
2 votes
0 answers
520 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/...
Rho Phi's user avatar
  • 287
1 vote
1 answer
2k 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 ...
arminb's user avatar
  • 171
1 vote
1 answer
3k 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 ...
jan's user avatar
  • 891
1 vote
1 answer
1k 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/...
komodosp's user avatar
  • 121
0 votes
1 answer
1k 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?
malaki106's user avatar
0 votes
1 answer
3k 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 ...
NotMe1993's user avatar
1 vote
1 answer
82 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 ...
Adel M.'s user avatar
  • 338
6 votes
1 answer
1k 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 ...
JoL's user avatar
  • 4,590
1 vote
0 answers
95 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 ...
EM90's user avatar
  • 111
0 votes
0 answers
70 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. ...
Michael Kohne's user avatar
1 vote
1 answer
768 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 ...
Phoenix87's user avatar
  • 121
2 votes
1 answer
391 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 ...
mYnDstrEAm's user avatar
  • 4,147
0 votes
1 answer
48 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 ...
arennuit's user avatar
  • 101
1 vote
0 answers
284 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: ...
Thiago's user avatar
  • 111
1 vote
0 answers
28 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 ...
phemmer's user avatar
  • 71.3k
0 votes
1 answer
1k 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 ...
Brave's user avatar
  • 13
0 votes
0 answers
44 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. ...
Pietro's user avatar
  • 581
3 votes
2 answers
2k views

Any way to make system time go slower or faster?

I'd like to make my system clock go slower or faster on Linux. On Windows, there's a handy freeware called "Time Travel". To get an idea of what it does, just check this image, everything is ...
Filys's user avatar
  • 31
3 votes
1 answer
14k 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 ...
cha0s's user avatar
  • 41
2 votes
1 answer
752 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 (-...
Biblot's user avatar
  • 178
3 votes
1 answer
633 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 ...
Franc's user avatar
  • 249
3 votes
0 answers
220 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 ...
nswerhun's user avatar
1 vote
0 answers
965 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 ...
Chad G's user avatar
  • 270
0 votes
2 answers
3k 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 ...
user199309's user avatar
3 votes
2 answers
164 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/...
Zyend's user avatar
  • 181
1 vote
0 answers
340 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-...
byulk's user avatar
  • 11
0 votes
1 answer
96 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 ...
Dzmitry Sankouski's user avatar
0 votes
0 answers
335 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-...
Botspot's user avatar
  • 151