Resetting clock after dead battery?

I’m running on a Librem. Every time the battery drains completely the internal clock is blanked.
I have to reset the clock manually in recovery mode using:
date -s (manually imputing date/time)
and then
hwclock --systohc

This gets the network working so long as I can get the time accurate to the second. But my 2 factors don’t work. I can imagine it is because of a time sync issue.
Is there another command that will resync the time with network time across all qubes?

My last laptop had no battery left at all and the internal clock resets with the date of 2013 everytime i start the laptop! but, once I was connected to the internet, By simply doing a
sudo qvm-sync-clock
the date and time would resynchronize directly with the network and everything was correct for the different qubes. I don’t know if it will change anything but is ntp sevice enabled?..

PS: i don’t use 2 factors.

qvm-sync-clock isn’t solving the problem.
Clocks appear to be synced with net time. 2 factors, still don’t work though.

Well, what is the 2FA you’re using? And even before that, did you set the correct Time Zone? (net time is UTC/Zulu).

2f is from password managers. Using date -s, I’ve set the time to the computer timezone setting.
Networks works afterward. 2 factors are still off. What does that suggest?

Sorry - no further ideas :thinking:

Do you use a debian-minimal template for you clockvm? In this case install systemd-timesyncd in the template and run qvm-sync-clock after that.

@Emily Maybe it’s a stupid question (sorry but my native language is not English so I may not have understood correctly) but Is your sys-net have the right time when connected to the internet?

Yes.

Strange…but it seems to have fixed itself.
This is the pattern. It dies… network goes down…I reset…sometimes network works…sometimes it doesn’t… I reboot… sometimes that works…sometimes it doesn’t…then it randomly fixes itself.

I always thought it could be the internal battery that was dead. Maybe it could come from there? Your problem happens when your battery is empty, a bit like me who couldn’t get a battery anymore… :confused: