How to read time in RTC?

,

How do you read the time on the rtc? I feel like there’s something wrong with it and it keeps setting the time and date to 2009 october.

You will need to open the configuration tools in the Terminal by typing:

argon-config

Choose the update RTC option. Make sure your are connected to the internet.

Then REBOOT to save the settings.

I’ve done that before. But, if you unplug it (and since I’m waiting to get an RTC battery) that clock dies and gets reset. It’s just annoying, because sometimes even if I set it, it still somehow gets reset to 2009 even if I didn’t unplug it.

Sorry about that. The RTC will need a battery if the unit is unplugged to keep its settings.

Depending on your O/S the Pi could also be using the fake hw-clock which may/may not be required with a RTC. (in another project i was working on i had to remove it) Still awaiting mine but will confirm this. (search google remove fake-hwclock)

Drew

Oh okay noted. I guess it should be mentioned that the RTC clock does not function correctly until you place a battery. May also act weird until you place a battery. I guess I’ll just wait until I get the battery.

Does anyone know what battery this RTC takes?

The battery is CR 1220

So here is an update even with a battery it picks up the wrong time. Not only on reboot but just sitting idle. Mine keeps changing to a 2021 date very odd behavior. I went into raspi-config and verified the right timezone but when I do the RTC update it does not work. Again I do have a CR1220 battery installed.

You can get the RTC time be set correctly by doing this on the raspbian:

  1. install argon-config (sudo curl https://download.argon40.com/argoneon.sh | sudo bash)
  2. run sudo timedatectl set-ntp 0
  3. run sudo timedatectl set-time "YYYY-MM-DD hh:mm:ss"
  4. sudo nano /etc/systemd/timesyncd.conf and then uncomment NTP= and add your ntp servers (pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org) and then save CTRL+X
  5. run timedatectl set-ntp 1
  6. run argon-config select to 3 for RTC clock, and the select 1 to sync system time TO the rtc clock.

Optional, set your timezone: sudo timedatectl set-timezone "America\Toronto" (change it your timezone, use timedatectl list-timezones if you want to see a list)

4 Likes

Thanks for your step by step it was a great help setting the correct time for my RTC

When I issue this command
sudo timedatectl set-time YYYY-MM-DD hh:mm:ss
system responds “Too many arguments.”

Actually, my bad… Needs to put the date and time in quotes… like above

I get the error: Failed to parse time specification “YYY-MM-DD hh:mm:ss” using your suggested input

Maybe a single quote/apostrophe maybe? instead of a double quote

In case anyone still is wondering about this- you need to put the actual datetime in the format of “YYY-MM-DD hh:mm:ss” not that string exactly.
So, for today, the command should be: sudo timedatectl set-time “2022-07-22 02:52:10”

1 Like