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
170 questions
115
votes
7 answers

Linux: set date through command line

How to change the system date in Linux ? I want to change: Only Year Only Month Only Date Any combination of above three
SHW
  • 14,454
  • 14
  • 63
  • 101
70
votes
9 answers

How do I set time and date from the Internet?

How do I retrieve the date from the Internet and set my computer's clock, from the command line?
Mohsen
  • 2,495
  • 4
  • 25
  • 29
20
votes
2 answers

Does crond handles summer time +1 hour change?

Last weekend we had to change the time from 02:00 to 03:00. Question: What would happen if there was a cronjob at 02:30? crond is a very old solution for scheduling, it should probably handle it, but don't know how.
LoukiosValentine79
  • 1,479
  • 3
  • 21
  • 43
19
votes
6 answers

Different time in Windows and Linux Mint

I have installed Linux Mint first on my Acer Aspire 4930 and then dual-booted with Windows 7. I always see the correct time on Linux Mint but on booting into Windows the time is shifted back by a few hours, even after resetting the time, on reboot…
Ballistic
  • 437
  • 1
  • 3
  • 9
16
votes
4 answers

How can I measure and prevent clock drift?

On several production platforms we have observed symptoms which appear to suggest that the time of day clock is periodically jumping forward or backward. The jumps are typically around 1 second, typically cancel out (jump forward then backward very…
brett
  • 301
  • 1
  • 2
  • 6
11
votes
1 answer

What is /etc/timezone used for?

On my Manjaro linux box, I have a file /etc/timezone which contains: Asia/Bangkok Another Manjaro forum user also has the same file. That thread on the whole contains some prior art on this question. What's strange is that timedatectl status…
Tom Hale
  • 28,728
  • 32
  • 139
  • 229
11
votes
1 answer

Is there any way to adjust the clock granularity under tmux?

It seems like, by default, the tmux status bar clock granularity is set to 2s, however it would be nice to be able to bring that up to a one-second granularity. Is there any way to set the granularity in a .tmux.conf? I haven't been able to find…
Jules
  • 2,064
  • 2
  • 24
  • 35
11
votes
2 answers

How to change the Gnome panel time format?

Gnome panel displays the time with 24hrs format but I want to change it to am/pm.
Luis Veliz
  • 475
  • 4
  • 8
  • 16
11
votes
5 answers

How to get system time with microsecond Resolution

I want to know current system time with microsecond Resolution. date +%s returns Time in seconds since epoch(1-1-1970). How can I get time in microseconds Resolution. How much delay is in querying this value? By delay I mean suppose at time t secs…
Coderaemon
  • 219
  • 1
  • 2
  • 6
11
votes
4 answers

How to move system clock time forward/backward?

I know commands for setting specific time and/or date, but can't find ones which move the time relative to the current time. What are the commands to move the time forward/backward x seconds/minutes/hours? (And possibly also days/months/years?)
dziadek1990
  • 685
  • 2
  • 8
  • 14
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,284
  • 40
  • 125
  • 208
9
votes
2 answers

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 updating the system clock. We see 2 to 3 of these a…
Philip Couling
  • 17,591
  • 5
  • 42
  • 82
8
votes
3 answers

Host CPU does not scale frequency when KVM guest needs it

Observation: I have an HP server with an AMD dual core CPU (Turion II Neo N40L) which can scale frequencies from 800 to 1500 MHz. The frequency scaling works under FreeBSD 9 and under Ubuntu 12.04 with the Linux kernel 3.5. However, when I put…
Huygens
  • 8,985
  • 3
  • 31
  • 36
8
votes
4 answers

Clock skews on remote machines

I am performing some experiments on a network of about 10 remote Linux computers which are geographically scattered. I suspect some of them have clock skews but they are seen transiently (eg. once in a week or twice in a month). I was wondering if…
Ketan Maheshwari
  • 9,054
  • 6
  • 40
  • 53
8
votes
2 answers

Change default sounds of gnome-clocks app

I'm use gnome-clocks for its timer option. This app is very simple and effective. But I can't change the default sounds of the alarm and the timer. I tried setting the configurations in dconf and Settings > Sound > Sound Effects but it's impossible…
user250189
1
2 3
11 12