14

I installed Arch a couple of days ago. Just realized the date/time were off by a day and one hour.

I changed it using timedatectl set-time. Then used hwclock --systohc to set the hardware clock. After that I was not able to enter some sites like Gmail because of https certificate errors. I tried changing the time back but it did not work.

I rebooted and then had problems because the partitions had mounted on a different time so I used fsck /dev/sda on my partitions and I was able to boot up. Right now the clock is not a problem but I really need to check my mail. I had to use Facebook to log in to stackexchange cringe.

Help?

This is what Gmail's error page say:

The server's security certificate is not yet valid! You attempted to reach gmail.com, but the server presented a certificate that is not yet valid. No information is available to indicate whether that certificate can be trusted. Chromium cannot reliably guarantee that you are communicating with gmail.com and not an attacker. Your computer's clock is currently set to Tuesday, January 10, 2012 12:14:47 PM. Does that look right? If not, you should correct your system's clock and then refresh this page.

You cannot proceed because the website operator has requested heightened security for this domain.

4 Answers 4

16

The correct way to do this would be by enabling ntpd.service via systemd.

# pacman -Syu ntp Installed the required package

# systemctl enable ntpd.service Enable it at boot so every time you boot the system the clock will be synchronized

# systemctl start ntpd.service Start it immediately

One could also run ntpd -qg as root.

Once you have systemd managing this operation, you should never have to worry about setting the clock agian.

note: there are some dual boot scenarios that will unsyncronize the clocks, there's also some registry hacks for the windows side of the dual boot to correct this issue.

3
  • For me command above did not work - but the following did pacman -Syu pacman -S ntp
    – meyerson
    Commented Oct 29, 2015 at 16:26
  • Can you shed some lights on "there's also some registry hacks for the windows side of the dual boot to correct this issue"?
    – Bruce Sun
    Commented May 27, 2019 at 15:47
  • one can do sudo systemctl enable ntpd.service --now to both enable and start it. the time didn't correct instantly, I restarted and then it took a few minutes before it was synced. Commented Feb 7, 2020 at 1:49
11

I used the ntp solution in this article. Updated against a time server.

I was getting an error at first. You have to stop ntp before using a time server. If it can't find a server you have to specify it, in my case I used: sudo ntpdate 0.us.pool.ntp.org. That did it.

1
  • "You have to stop ntp before" did the trick! Thanks!
    – Yashank
    Commented Oct 20, 2021 at 9:30
10

If you are new to (Arch) Linux and just want to know how to enable NTP, just do

timedatectl set-ntp true

and that's it.

2
  • This fixed my time. What does this do exactly?
    – alvitawa
    Commented Oct 7, 2021 at 9:16
  • 1
    @alvitawa This will enable the Network Time Protocol deamon which auto-syncs your time with a time server using its protocol. Since it's syncing now and then, you never have to take care of your time, again, even when your clock changes in the country of your location. Commented Oct 7, 2021 at 22:06
0

I tried the solutions above but the problem persisted.

but this hack did the job

timedatectl set-local-rtc 1

It basically tells arch to use local time instead of UTC


you can revert this back to UTC by using

timedatectl set-local-rtc 0

source: System Time ArchWiki

2
  • I doubt this would solve OP's problems which says "date/time were off by a day and one hour" I am not aware of any place where local time is UTC +/- 25 ! :-P
    – MC68020
    Commented Aug 16, 2022 at 8:58
  • funny :D, but i just wanted it to be known for ppl in other regions
    – Farhad
    Commented Aug 16, 2022 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .