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").

Computers have different hardware- and software-based means of keeping and managing the system time.

Most servers and desktop PCs have a battery-buffered real-time clock chip which continues to keep track of absolute date and time even if the system is powered off. Once the system boots, this time is loaded into the kernel's timekeeping architecture, which provides interfaces for programs to access

  • the absolute date and time (also referred to as "wall-clock time"), which is not monotonic as it is affected by adjustments due to leap-seconds and daylight-saving time
  • various timestamp counters that count elapsed time since some more or less well-defined moment in history, and are usually monotonic

The kernel's timekeeping can be improved by synchronizing system time to a high-accuracy time source, ither using a hardware receiver for time signal broadcasts (e.g. a GPS receiver) or via network protocols that query time from a national or international time standard.

Some embedded systems (such as the Rasbperry PI) do not have a real-time clock chip and rely entirely on external time sources for accurate wall-time clock, which will be lost once the computer is powered down.

External links

Related tags

  • and : network protocols for synchronizing a computer's local time to a high-accuracy time server
176 questions
10
votes
1 answer

How exactly is tzdata database used?

Different operating systems seem to handle daylight-saving time(DST) differently. I really like the Cisco IOS approach which is very simple and allows one to change the date and time when DST starts and ends. For example: clock summer-time EDT…
Martin
  • 7,516
2
votes
2 answers

Restore clock after short powerdown for no-network, no-RTC system

I've made a programmable power switch using Raspberry Pi (although this question is not RPi specific - it's more of "generic Linux" with problem caused by hardware shortcomings.) Raspberry has no battery-backed RTC; it's intended to work networked…
SF.
  • 2,941
2
votes
1 answer

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 should look out for. According to…
i336_
  • 1,017
1
vote
1 answer

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 clock, see #Time synchronization. Set the hardware…
jan
  • 911
0
votes
2 answers

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 0.25μA TYP (VDD =3.0V, TA =25℃). Connector P/N:…
Daniel
  • 339