Skip to main content

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
7 votes
1 answer
293 views

select() / poll() timeout stretches on Linux

Whilst writing this answer to another Q&A here, I noticed that the timing in the zsh solution that uses select() to sleep for a given number of centiseconds was off by an amount larger than what I ...
Stéphane Chazelas's user avatar
3 votes
0 answers
44 views

Linux clock source from FPGA

I'm trying to get the Linux kernel (and system as a whole) to sync to a monotonically incrementing clock from a FPGA register in memory. The clock is 64-bits wide and divided into two 32-bit sections: ...
Ryan Sherlock's user avatar
2 votes
1 answer
423 views

PTP time syncing not working, why its always selecting best master clock as local clock?

I am trying to sync the time with PTP; I've configured the Trimble device with PTP. However, when I use LinuxPTP with the below configuration, the local clock is always selected as the best master ...
Elshan's user avatar
  • 123
0 votes
4 answers
264 views

System clock offsetting from HW clock on boot

I recently did a full update to my Arch Linux system and now, for some reason, the system clock is being set to an offset of +5 hours on boot, compared to the HW clock. I am in US EST (UTC-5). When I ...
Time4Tea's user avatar
  • 2,405
1 vote
1 answer
53 views

How does Kernel Clock Rate matter in network emulation (by netem)?

I want to use network emulation (netem) on a PREEMPT-RT kernel to emulate latency and jitter down to 0.5 ms +- 10 %. Thus, I initially thought that I have to adapt the internal kernel clock rate to at ...
JanMrt's user avatar
  • 13
0 votes
0 answers
36 views

How can I force systemd journalctl to output log in sequential order in case of frequent clock changes?

I have a standalone debian-based system that -- for the simplicity -- can be taken as not having RTC. The system clock can be set during operation, both forwards and backwards. I thought that ...
Ferenc's user avatar
  • 101
0 votes
2 answers
4k 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
1 answer
180 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
126 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
426 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
411 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
  • 21
0 votes
1 answer
2k 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
229 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
1 vote
0 answers
217 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
860 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,398
1 vote
4 answers
11k 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
  • 127
0 votes
1 answer
266 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
1 answer
485 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
540 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
  • 702
0 votes
1 answer
459 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
7 votes
3 answers
4k 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
969 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
383 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
3k 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
  • 397
3 votes
1 answer
915 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
  • 151
3 votes
0 answers
646 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
  • 319
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
  • 921
1 vote
2 answers
2k 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
2k 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
92 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
  • 358
7 votes
1 answer
2k 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,795
1 vote
0 answers
112 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
71 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
958 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
  • 131
2 votes
2 answers
529 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,398
0 votes
1 answer
72 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
367 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
37 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
  • 72.3k
0 votes
1 answer
2k 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
  • 113
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
  • 573
3 votes
2 answers
3k 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
16k 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
878 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
750 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
  • 299
3 votes
0 answers
231 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
  • 113
1 vote
0 answers
1k 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
1 vote
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