Archived

This topic is now archived and is closed to further replies.

reaction

Windows (3.1/9X/ME/2K/XP) Daylight Savings behaviour

Recommended Posts

Hi, I need some confirmation on the behaviour of windows during a Daylight Savings crossover. If the time is changed under Windows (XP - for sure) it alters the system (BIOS) clock. However, I don''t know what windows does at the Spring and Autumn DS Crossover. It''s not logical for Windows to change the system clock, as other OS''es will not know the clock has been adjusted, and may repeat the operation. So, does windows jog the time to allow for DS internally? and what time does the MSVC 6.0 {ULONG time(NULL);} funtion return, system BIOS time, or windows time? From the MSDN docs... "The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock." ... does this mean the number returned by {time(NULL;} is not affected by DS? Thanks, R
ToDoList | Wayout | ManillaPush | SendToSync

Share this post


Link to post
Share on other sites
possibly it rather sets an "in-summer-time" flag in the bios.. dunno.. wich other os'' look at and say oh, its yet set..

i have no clue, but that would at least be a solution:D

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Thanks daveperman,

There is a flag set in the 'tstruct' structure of {_ftime(tstruct);}. I'm thinking of using this, but if the BIOS is already changed, then the variable is irrelevant.

Thanks Nik02,

Thanks for the confirmaion, surely that philosophy is a bit dangerous (and unsociable!), esp. if there are more than two users who don't know wether the other has adjusted the clock, and it get's adjusted twice!

I need some more (official) confirmation though... I'll try to look around the internet.

R



ToDoList | Wayout | ManillaPush | SendToSync


[edited by - reaction on September 1, 2003 3:17:09 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by reaction
It''s not logical for Windows to change the system clock, as other OS''es will not know the clock has been adjusted, and may repeat the operation.


A bit naive, are we?

Share this post


Link to post
Share on other sites
quote:
So, does windows jog the time to allow for DS internally?

It is supposed to.

quote:
and what time does the MSVC 6.0 {ULONG time(NULL);} funtion return, system BIOS time, or windows time?

Why not try it and find out?

Share this post


Link to post
Share on other sites
Windows changes the BIOS clock. I had Windows 98 and Windows XP dual-booted, and last April I found my computer''s clock an hour behind (or an hour ahead?) But both of the OSs changed the clock.

Share this post


Link to post
Share on other sites
quote:
Original post by reaction
who are you???

R

Sounds like a question someone from Tribes would say:

WHO ARE YOU TO MAKE SUCH A STATEMENT MR ANTAREUS?!!?
GEE I WAS IN 5150 ONCE THAT CHANGES EVERYTHING DOESN''T IT!

Since I must be literal: MS doesn''t give a damn about other operating systems you have, hopefully you know that. So, it doesn''t care if the other OSes ALSO change the BIOS time. They operate as if they are the only OS installed since that is how about 98% of their users are.

Share this post


Link to post
Share on other sites
Thanks for the replies,

The system will work like this...

When the computer is manufactured the constant clock will be set to the correct (global, unadjusted) time.

The second clock will have an offset from the first; to set it to the correct (local) time.

The advantages will be that...

(1) any software that needs to know the exact and unaltered time, regardless of locale, they will use the constant clock, and will always be correct.

(2) any other software should use the second clock.

(3) any OS operations that require local time will use the second clock, but the OS developers will have cooperate and negotiate a flag to indicate DST (possibly also in the BIOS).
An alternative to this would be that the OS kernel jog the time for every operation (or possibly just at startup).

The constant clock would mean that whatever happens to the second clock, the correct time will always be derivable, in one way or another.

As far as I am aware, not a single PC, anywhere (except possibly miltary machines), can report the time with a n y degree of accuracy at all.

Please email your local PC mnfctrs.

R

Share this post


Link to post
Share on other sites
Also, the clocks should probably be 64 (128?) bit representations of seconds since a, yet to be decided, date a few hundred years in the past.

R

[edited by - reaction on October 31, 2003 11:22:35 AM]

Share this post


Link to post
Share on other sites
This is a problem throughout things. If I take my computer to the US, I''ll have to set the time back by 5 hours at least. DST would have the exact safe effect as moving one timezone forward/backward, depending on the time of year.

That''s why I don''t think this is a BIOS problem - rather, it''s an OS problem. The OS shouldn''t be changing the clock to respond to DST; it should be tracking DST, along with its timezone information, internally.

Reporting it to the Linux development community could be the best start, as you''re almost guaranteed to get something done that way. Apple as well, as it''d be part of the Darwin kernel (I think). MS.. possibly. Not that they tend to give a damn about interopability with other OSes on the same machine.

BTW, your website gives the impression that you''re overreacting horribly. I can''t even find out what your software does, let alone why this problem would affect it.

Richard "Superpig" Fine
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4 | Enginuity5
ry. .ibu cy. .y''ybu. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu
"Don''t document your code; code your documentation." -me

Share this post


Link to post
Share on other sites
quote:
Original post by reaction
It's not logical for Windows to change the system clock, as other OS'es will not know the clock has been adjusted, and may repeat the operation.



Windows always assumed it was the one and only operating system on your machine.

Several C time functions have a 'timezone' parameter you can use (or will implicitely use the TZ environment variable). That's how Unix systems (normally) adjust for daylight saving time - the internal clock itself should not be modified.


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]


[edited by - Fruny on October 31, 2003 3:09:47 PM]

Share this post


Link to post
Share on other sites