You are not logged in.

#1 2025-03-08 17:31:59

LeonN
Member
Registered: 2022-12-19
Posts: 92

[SOLVED] Not sure if my system time is well configured

I'm dual booting Arch and Windows 10. My bios clock is set to UTC time. Windows is already set up to use UTC (I updated the registry and set my timezone to my actual timezone UTC-5). Windows is displaying the right time.

Now, in Arch, my time is right as well: it is displaying the current time for my timezone. The thing is that timedatectl says:

❯ timedatectl
               Local time: Sat 2025-03-08 11:51:04 -05
           Universal time: Sat 2025-03-08 16:51:04 UTC
                 RTC time: Sat 2025-03-08 16:51:04
                Time zone: America/Lima (-05, -0500)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

Everything seems perfect, the UTC time is the right one and so is and my local time. hwclock --show outputs this:

❯ sudo hwclock --show
2025-03-08 11:57:32.101757-05:00

Not sure if the output is the expected.

The problem is that NodeJs is assuming my local time is the UTC one.

const newDate = new Date();
// outputs: 2025-03-08T17:28:02.285Z

As far as I know, the date object should print the date in local time. I don't know if that is a nodejs issue or a misconfiguration in my system. I want to discard the second option to search for help else where. Thanks.

Last edited by LeonN (2025-03-09 17:40:37)

Offline

#2 2025-03-08 17:36:54

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: [SOLVED] Not sure if my system time is well configured

From the hwclock man page:

       -r, --show; --get
           Read the Hardware Clock and print its time to standard output in the ISO 8601 format. The time shown is
           always in local time, even if you keep your Hardware Clock in UTC. See the --localtime option.

Everything points to the system being fine.

Offline

#3 2025-03-08 18:21:45

LeonN
Member
Registered: 2022-12-19
Posts: 92

Re: [SOLVED] Not sure if my system time is well configured

Good to know. Just one more doubt before marking this as solved.
How about this?

System clock synchronized: no

As Arch Wiki says, this should be done automatically every 11 minutes, how come mine says it is not synchronized?

Offline

#4 2025-03-08 18:28:05

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: [SOLVED] Not sure if my system time is well configured

That's saying it's not synced to NTP, syncing to the HW clock is different.

Offline

#5 2025-03-09 15:24:37

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [SOLVED] Not sure if my system time is well configured

tl;dr the console(.log()) output of a Date object may vary depending on the js runtime. As long as the actual time is correct though everything is fine.

edit: if you want/need it in a specific formate/timezone then use appropiate functions like .toSting(), .toISOstring(), .toUTCstring() or what fits your usecase

Last edited by Mr.Elendig (2025-03-09 15:29:58)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2025-03-09 17:40:25

LeonN
Member
Registered: 2022-12-19
Posts: 92

Re: [SOLVED] Not sure if my system time is well configured

Scimmia wrote:

That's saying it's not synced to NTP, syncing to the HW clock is different.

Thanks, I have a better understanding of it.

As for the node js issue, I don't think this is the place to discuss it or debug it. Thanks for helping, anyways. I'll mark this as solved.

Offline

Board footer

Powered by FluxBB