7b_w
Posts: 2
Joined: Sat Dec 19, 2015 4:12 am

DS1307 RTC 12/24 hour time setup

Wed Apr 13, 2016 5:47 pm

Hello,
I have an old version Raspberry Pi model B that I have successfully added an DS1307 RTC to. I can read back the time in
terminal using hwclock -r and it returns the date and time ok but it returns the time in 12 hour format and I would like it to return
time in 24 hour. Is there a utility that i can run to setup the DS1307 to change this? I see on the Raspbian GUI the time
shown on the upper right hand corner is in 24 hour format so not sure how that got set that way but is fine with me. I don't use
GMT only local time where i am located but still want 24 hour format.
Thanks,
Bruce

rayjoh
Posts: 27
Joined: Thu May 23, 2013 11:48 am

Re: DS1307 RTC 12/24 hour time setup

Thu Apr 14, 2016 7:01 am

I suppose it is different locales for your user and root.
Try the commands

Code: Select all

locale
sudo locale
-- Raymond

7b_w
Posts: 2
Joined: Sat Dec 19, 2015 4:12 am

Re: DS1307 RTC 12/24 hour time setup

Fri Apr 15, 2016 8:20 pm

Made some changes from DS1307 to DS3231 (model ZS-042) and did the resistor mods to it also.

It seems that system time was already set for 24 hour format but the RTC (DS3231) is set for 12 hour format but this
is ok since the system clock gets loaded form the RTC (no Ethernet or WiFi connected) and system reverts to 24 hour
format which is what I was looking for.

Return to “General discussion”