Page 1 of 1
rtc help
Posted: Fri Feb 09, 2007 6:20 am
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?
Posted: Fri Feb 09, 2007 6:41 am
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).
Posted: Fri Feb 09, 2007 11:34 am
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