Page 3 of 3
Re:Timer Interrupt
Posted: Sun Mar 28, 2004 4:56 pm
by Tim
Summer/winter time is a huge can of worms. Basically: There's no formula which will predict when the changeover point is for all locations. The US and UK are easy. Elsewhere the rules change from time to time. Some countries don't change their clocks. Some countries (e.g. Israel) decide the changeover points on a year-by-year basis.
See
here for why summer/winter time is so hard to get right, and what Win32 and .NET do about it (they handle it differently, by the way).
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 2:21 am
by bubach
i changed my clock to summer-time yesterday..
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 7:36 am
by DennisCGc
Me too ;D
Here the rules are:
- the last weekend of March, the clock must be set to summer time, on Sunday
- the last weekend of October, the clock must be set to winter time, on Sunday.
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 7:44 am
by Candy
DennisCGc wrote:
Here the rules are:
- the last weekend of March, the clock must be set to summer time, on Sunday
- the last weekend of October, the clock must be set to winter time, on Sunday.
If you'd read Tim's post, you'd know it's not that easy. The point of it all is that the rules are NOT worldwide the same, NOT constant over time, and even HOW you apply the winter/summertime is not constant, even in one OS (well, that's probably a windows-only thing).
It's harder than that.
Microsoft comment for the people that are too lame to click on the link:
Another reason is that the laws regarding daylight savings time are in constant flux. For example, if the year in the example above was 1977 instead of 2000, the conversion would have been correct because the United States was running on year-round Daylight Savings Time due to the energy crisis. Of course, this information isn't encoded anywhere in the TIME_ZONE_INFORMATION structure. Similarly, during World War 2, the United States went on DST all year round. And between 1945 and 1966, the DST rules varied from region to region.
DST rules are in flux even today. The DST cutover dates in Israel are decided on a year-by-year basis by the Knesset. As a result, there is no deterministic formula for the day, and therefore no way to know it ahead of time.
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 7:51 am
by DennisCGc
Candy wrote:
DennisCGc wrote:
Here the rules are:
- the last weekend of March, the clock must be set to summer time, on Sunday
- the last weekend of October, the clock must be set to winter time, on Sunday.
I MEAN, in the Netherlands, Here is referencing to HOLLAND! >:(
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 7:56 am
by Therx
OT : why are the netherlands sometimes called holland?
Pete
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 7:59 am
by DennisCGc
Pete wrote:
OT : why are the netherlands sometimes called holland?
Pete
Don't know, HOL means hollow, so, maybe it has a meaning ::)
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 8:59 am
by Solar
Dennis, I am surprised that you - referring to the Netherlands as "here" - don't know...
The formal name of the country is Netherlands, full stop.
There are several counties (or however you'd call them in English) that constitute the Netherlands. The most important of them happen to be North Holland and South Holland. Zeeland and Groningen are two more.
The overwhelming importance of Holland (and the comparative "complexity" of the word "Ne-ther-lands") led to "Holland" being used synonymously.
Happens easier than you'd think. Most US people think all of Germany has mountains, people wearing Lederhosen and eating lots of Sauerkraut.
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 9:11 am
by DennisCGc
Uhm, do you know what the Netherlands means ?
And, unlike the United States, The Netherlands has provinces, and we're united, which means, every province has the same rules, and each state in the U.S. has other rules, except the basic rules.
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 9:13 am
by Candy
Solar wrote:
There are several counties (or however you'd call them in English) that constitute the Netherlands. The most important of them happen to be North Holland and South Holland. Zeeland and Groningen are two more.
*feels the need for completion*
Their actual name should be "province", the dutch name is "provincie" (which is pronounced the same, but the ending ie is pronounced similar to an english y, and it gets the focus)
The full list is Zuid-Holland, Noord-Holland, Zeeland (these three comprise the east), Utrecht in the center, Drente, Groningen and Leeuwarden in the north, Limburg, Noord-Brabant and Gelderland in the south and Overijssel in the east. Since somebody called Leeghwater (which through translation becomes empty-water) emptied out some of the IJsselmeer of water, it now contains a province called Flevoland. That constitutes all 12 provinces
Enough of this, let's get back to topic (and that's not summertime or even time, but the timer interrupt).
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 9:31 am
by ich_will
Thats all very fine but like Candy says thats have nothing to do with my problem. How can I get the correct dates etc. from my secs variable? Or should I do something else?
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 9:39 am
by DennisCGc
Read the CMOS its registers.
Because the CMOS "keeps on running", you only have to read its date.
And, if your OS switchs from 23:59 to 0:00, then you should increase your day register.
If the day is over 31 (or 30 or 29, depends on what month it is), it should increase the month, if month is over 12, increase year.
If you don't know sure about the months(eg. how many days they have), then you should read the CMOS again (when switched a day).
HTH.
Re:Timer Interrupt
Posted: Mon Mar 29, 2004 9:45 am
by Candy
ich_will wrote:
Thats all very fine but like Candy says thats have nothing to do with my problem. How can I get the correct dates etc. from my secs variable? Or should I do something else?
*goes back to topic*
Your dates & everything are in BCD format. (direct quote from reply #1 and #2)
You convert them using dec= bcd-((bcd>>4)*6); (direct quote from reply #5)
Every N interrupts (where N is the frequency of your timer) you can increase the internal timer in your OS. Or, at your option, read out the CMOS time again. You can also use the timer interrupt for normal second / minute counting and sync with an NTP server every hour
What you do is completely your choice, however.