You are not logged in.
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: noEverything 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:00Not 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.285ZAs 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
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
Good to know. Just one more doubt before marking this as solved.
How about this?
System clock synchronized: noAs Arch Wiki says, this should be done automatically every 11 minutes, how come mine says it is not synchronized?
Offline
That's saying it's not synced to NTP, syncing to the HW clock is different.
Offline
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
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