rtc help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

rtc help

Post by digo_rp »

guys I have a function that get date direct from rtc chip

I´m having problems cuz on some pc´s I have a week day like

today is monday in some pc week day I get right
in others one I get something like weekday - 1
like sunday

any one could help me?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Welcome in the big wide world of internationalization. Depending on country, the week begins on different days (Sunday and Monday I know for sure, I don't know if there are yet others).
Every good solution is obvious once you've found it.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Post by Brendan »

Hi,

From a very good document called "pctim003.txt" that I downloaded from somewhere a long time ago:
The day of week register (register 6) simply counts 1, 2, 3, 4, 5, 6, 7, 1,
2... where 1 means Sunday, 2 means Monday, etc. The RTC does not calculate
the day of the week from the date. This register must be set by software.
It is not used by the BIOS RTC functions or by DOS and will not necessarily
be set correctly. Software normally calculates the day of week from the other
date information rather than using this register. The RTC uses this register
to switch between standard time and daylight saving time if daylight saving is
enabled, but the daylight saving function is not used in PCs so there is no
need to make sure that this register is set correctly.
Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply