From the OSDev Wiki (emphasis added):
The RTC chip is able to keep track of the current day of the week. All it does is increment its "Weekday" register at midnight and reset it to zero if it reaches 7. Unfortunately there is no guarantee that this register was ever set correctly by anything (including when the user changes the time and date using the BIOS configuration screen). It is entirely unreliable and should not be used.
The correct way to determine the current day of the week is to calculate it from the date.
I believe this answers both your original question and why changing the RTC date manually with hwclock
does not show changes to the weekday offset (0x07
). If it's simply a roll-over counter at midnight, that explains a lot.
As for calculating the day of the week from the date while not using system time functions such as strptime
, have a look at this StackOverflow thread: C Program to find day of week given date