Artix Linux Forum

Init systems => OpenRC => Topic started by: Comexs on 13 June 2022, 09:51:23

Title: Wrong Time [SOLVED]
Post by: Comexs on 13 June 2022, 09:51:23
The time on my pc is wrong. Like for example right now its 2022/06/13 00:39:16 but it says its 2022-06-12 17:39:15

Code: [Select]
Artix:[comexs]:~$ hwclock --verbose
hwclock from util-linux 2.38
System Time: 1655080864.938165
Trying to open: /dev/rtc0
hwclock: cannot open /dev/rtc0: Permission denied
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
I not sure is this is normal.

Code: [Select]
Artix:[comexs]:~$ sudo hwclock --verbose
hwclock from util-linux 2.38
System Time: 1655080755.960178
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1655078067 seconds after 1969
Last calibration done at 1655078067 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2022/06/13 00:39:16
Hw clock time : 2022/06/13 00:39:16 = 1655080756 seconds since 1969
Time since last adjustment is 2689 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2022-06-12 17:39:15.937005-07:00
so the time were it says "Time read from Hardware Clock" is the right but the time at the bottom is wrong.

Code: [Select]
Artix:[comexs]:/etc/localetime$ ls
Los_Angeles

Code: [Select]
Artix:[comexs]:/etc/localetime$ date
Sun Jun 12 05:49:47 PM PDT 2022


I dual booting Artix (OpenRC) and Windows but they are both on separate drives.
Title: Re: Wrong Time
Post by: Everyone on 13 June 2022, 10:05:28
The Artix Wiki (https://wiki.artixlinux.org/Main/Installation#Set_system_clock) is very helpful in this regard. Don't forget to also check Arch Wiki (https://wiki.archlinux.org/title/System_time#UTC_in_Windows). It has several tips on clock issues when dualbooting with Windows. Keep in mind hwclock needs to be run with root privileges.
Title: Re: Wrong Time
Post by: Comexs on 13 June 2022, 10:07:00
The Artix Wiki (https://wiki.artixlinux.org/Main/Installation#Set_system_clock) is very helpful in this regard. Don't forget to also check Arch Wiki (https://wiki.archlinux.org/title/System_time#UTC_in_Windows). It has several tips on clock issues when dualbooting with Windows.
I have already done that but didn't help me.
Title: Re: Wrong Time
Post by: gripped on 13 June 2022, 10:51:12
I'm not sure but is the 'correct' time you say the hwclock is, the correct UTC time, or the correct Los_Angeles time.
Because if it's the correct Los_Angeles time ( it's expected to be UTC) then it will be shifted seven hours back by the Los_Angeles timezone setting. Which appears to be what is happeining ?

Make sure the hardware clock is set to UTC time.
Title: Re: Wrong Time
Post by: Comexs on 13 June 2022, 11:06:02
I'm not sure but is the 'correct' time you say the hwclock is the correct UTC time or the correct Los_Angeles time.
Because if the correct Los_Angeles time ( it's expected to be UTC) then it will be shifted seven hours back by the Los_Angeles timezone setting. Which appears to be what is happeining ?

Make sure the hardware clock is set to UTC time.
How do I know if the hardware clock is set to UTC?
Title: Re: Wrong Time
Post by: gripped on 13 June 2022, 11:13:07
How do I know if the hardware clock is set to UTC?
Code: [Select]
sudo hwclock --verbose

Does
Code: [Select]
Time read from Hardware Clock: ----------------
Show your local time or utc time ?
https://www.timeanddate.com/worldclock/timezone/utc
Title: Re: Wrong Time
Post by: Comexs on 13 June 2022, 11:19:56
Code: [Select]
Time read from Hardware Clock: 2022/06/13 02:14:39
This the time where is I live next to Los Angels.

On the web site you linked isn't the right time. (7 hours ahead from where I live)
Title: Re: Wrong Time
Post by: gripped on 13 June 2022, 11:22:21
The way my time is kept correct is
Code: [Select]
ntpdate  -b -s -u 0.uk.pool.ntp.org &
in /etc/rc.local
you can get ntpdate from package ntp.

If you run from the terminal add sudo.
Title: Re: Wrong Time
Post by: gripped on 13 June 2022, 11:25:47
Code: [Select]
Time read from Hardware Clock: 2022/06/13 02:14:39
This the time where is I live next to Los Angels.

On the web site you linked isn't the right time. (7 hours ahead from where I live)
If you really want the Hardware Clock to be set to your local time (As stated it's supposed to be set to UTC, 7 hours ahead of you), then DON'T set a timezone of Los Angeles. Set it to UTC. But that's a convoluted way of doing things and may cause other issues.

Linux expects your Hardware Clock to be set to UTC time.
Title: Re: Wrong Time
Post by: mrbrklyn on 11 December 2022, 04:33:19
The time on my pc is wrong. Like for example right now its 2022/06/13 00:39:16 but it says its 2022-06-12 17:39:15

Code: [Select]
Artix:[comexs]:~$ hwclock --verbose
hwclock from util-linux 2.38
System Time: 1655080864.938165
Trying to open: /dev/rtc0
hwclock: cannot open /dev/rtc0: Permission denied
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
I not sure is this is normal.



Are you running it without root access?    In your first example, that is what it looks like.
Title: Re: Wrong Time
Post by: Comexs on 11 December 2022, 05:03:13

Are you running it without root access?    In your first example, that is what it looks like.
My problem has already been solved I forgot to update this post since I did I bunch of random things and It something worked.
Title: Re: Wrong Time [SOLVED]
Post by: Comexs on 03 April 2023, 18:37:14
I switch my motherboard to UTC as gripped recommended. also I have to use the next command every time I boot back from windows
Code: [Select]
ntpdate -b -s -u 0.us.pool.ntp.org
Title: Re: Wrong Time [SOLVED]
Post by: nous on 03 April 2023, 18:44:27
I switch my motherboard to UTC as gripped recommended. also I have to use the next command every time I boot back from windows
Code: [Select]
ntpdate -b -s -u 0.us.pool.ntp.org
https://wiki.archlinux.org/title/System_time#UTC_in_Microsoft_Windows