Questions tagged [hwclock]
21 questions
14
votes
5 answers
How Do You Programmatically Set the Hardware Clock on Linux?
Linux provides the stime(2) call to set the system time. However, while this will update the system's time, it does not set the BIOS hardware clock to match the new system time.
Linux systems typically sync the hardware clock with the system time…

Kristopher Johnson
- 81,409
- 55
- 245
- 302
9
votes
4 answers
Set the hardware clock in Python?
How do I set the hardware clock with Python on embedded Linux systems?

Diego Sueiro
- 91
- 1
- 1
- 3
4
votes
1 answer
How to get current timestamp of realtime-clock (RTC)?
I would like to get the current timestamp of realtime clock in my BASH script. The hwclock command can print out the current time, but it is not timestamp.
I have considered parsing hwclock's output and then convert the results to a timestamp, but…

Xavier Young
- 368
- 3
- 8
3
votes
1 answer
hwclock: Cannot access the Hardware Clock via any known method
I'm using the Ubuntu bash shell provided by Windows 10 and I want to see my hardware clock time by using hwclock but I keep getting Errors.
hwclock
root@DESKTOP:/home/blondinl# hwclock
hwclock: Cannot access the Hardware Clock via any known…

Yorikiri
- 39
- 1
- 4
2
votes
2 answers
Time zone and BST woes in Europe/London
I am really struggling with my hwclock since the UK changed to British Summer Time (BST) last weekend on my Centos 5.8 KVM guest.
Here's some command outputs..
[root@host ~]# TZ=Europe/London date
Mon Apr 2 08:12:03 EDT 2012
…

Daniel Procter
- 188
- 1
- 2
- 16
2
votes
1 answer
Chrony sets system time but does not sync RTC
I have configured Chrony with rtcsync flag, which SHOULD "Enable kernel synchronization of the hardware real-time clock (RTC)", but that is not the case.
Chrony sets the system time correctly with ntp, but the RTC is untouched, and i can't seem to…

Varyag
- 676
- 12
- 29
2
votes
2 answers
Yocto/Poky: How to remove hwclock from busybox?
I'm building a Poky-based embedded Linux distribution for a target which doesn't have a real-time clock. System time is only set by ntpd. Therefore I don't really need an init script which calls hwclock --hctosys during boot, and in fact I'm afraid…

Georg P.
- 2,785
- 2
- 27
- 53
1
vote
1 answer
Hwclock shows wrong output with custom RTC driver
I'm trying to use a DS3231 with a Beaglebone Black. I'm custom system I built with buildroot (BusyBox v1.31.1), I also wrote the driver I'm using, this is an university assignment, so I can't use prebuilt systems or any existing drivers.
I'm…

AxelElRojo
- 61
- 1
- 6
1
vote
0 answers
Why can't linux read hwclock some month shift?
We have a linux system that we are building with yocto.
We can read our hardware clock after reboots, change both system time and hardware time without any error (most of the time). However; after some new month, every year that we have tried we are…

Ostpanaka
- 75
- 8
1
vote
1 answer
What do the `freq-offset-ppm` and `tick` columns in the output of `hwclock -c` mean?
My system clock is about 2m ahead of real time. I'm about to fix it, but decided to run hwclock -c just for fun. My results:
hw-time system-time freq-offset-ppm tick
1542485037 1542484930.078367
1542485047 1542484940.080521 …
user354134
1
vote
0 answers
Raspberry PI Zero DS3231 RTC
I have an Raspberry PI Zero and want to add a HWClock DS3231 (https://www.amazon.de/DS3231-RTC-Modul-f%C3%BCr-Raspberry/dp/B01B4IV30C/ref=sr_1_fkmr0_2?s=computers&ie=UTF8&qid=1486456449&sr=8-2-fkmr0&keywords=raspberry+pi+zero+rtc) on it.
On my…

user2577327
- 11
- 1
1
vote
1 answer
How to configure buildroot to set the hwclock when date is changed?
Using buildroot 2013.05 (with Freescale i.MX6 CPU).
When I change date/time from console, e.g.: date -s "2013-11-26 02:11", this setting will lost during reboot. I'd learned, that I have to call hwclock -wu afterwards.
But what's the way to…

Joe
- 3,090
- 6
- 37
- 55
0
votes
1 answer
Angstrom Boot on Beagleboard hangs
I am trying to boot Angstrom on the Beagleboard xM rev B.
I created boot-able drive and another drive to put the root file system, and when I start running the beagleboard, it boots but it hangs after displaying the following message:
hwclock: can't…

Karim
- 1,526
- 4
- 13
- 16
0
votes
0 answers
Yocto: set date and time without ntp
on my embedded device with YOCTO and none ethernet connection I would set a specific date and keep it udpdate after the device power-off.
I tryed with :
date --set '2022-05-25 11:17:00'
hwclock --utc --systohc
poweroff
but at power on the dat&time…

H2O
- 153
- 1
- 1
- 13
0
votes
1 answer
mktime() returns an incorrect value right after entering DST
The following snippet code is from rtc.c in busybox-1.22.1.
In my case the utc is always 0, so this function is just doing a conversion from struct tm to time_t.
time_t FAST_FUNC rtc_tm2time(struct tm *ptm, int utc)
{
//fprintf(stdout,…

Mr.nerd3345678
- 45
- 6