I'm using SetLocalTime API in order to update an iPaq's clock according to
user's request.
Whenever the user updates the time, I should update another device's clock
using rs232.
I noticed the following:
When changing from summer to winter and the other way around (e.g. 1 sept 08
<==> 1 Jan 08),
DateTime.Now returns 1 hour less / more than the hour I set using the
setlocal time...
e.g. when moving from Sept to Jan it moves back 1 hour, and add an hour when
moving from Sept to Jan...
DateTime.Now that suppose to return local time as was set returns +- 1 hour.
More over, this is happening when Regional settings are set to Pacific US
(G.M.T -8) and doesn't happen
when using G.M.T + 2 (Cairo for example).
1- Why DateTime.Now return something else than what was set by setlocaltime?
2- How can I be sure that GMT + 2 will work for all dates?
3- I've read that SetLocalTime need to be called twice in order to fix a
relevant bug (it update daylight saving according to the original date and
not the new one). I tried it, but it didn;'t solve the problem.
Any clues?
Thank you very much.
Empi
Paul T.
"Empi" <mpe...@softstart.co.il> wrote in message
news:eG5Z8%235JJH...@TK2MSFTNGP04.phx.gbl...
Yes. I do know what daylight saving is.
I found no option on the iPaq 2190 to enable/disable daylight saving.
I simply need an option for the user to set system's date and time using my
application.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:O1CSf88J...@TK2MSFTNGP03.phx.gbl...
OK, so you're doing exactly what the Date/Time Control Panel applet does, so
you shouldn't expect to be able to do better than what it does. I presume
that you see the same shift of time when you change it there, right? You
could, I suppose, check the return value of GetTimeZoneInformation() before
and after the time/date change to see whether you've shifted from daylight
time to standard time or vice versa and then set the time again to avoid the
hour jumping. If you change the date/time and the result of
GetTimeZoneInformation() is the same before and after, I don't think you
have to do anything.
Paul T.
"Empi" <mpe...@softstart.co.il> wrote in message
news:OcvCMT%23JJH...@TK2MSFTNGP05.phx.gbl...
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:uL5%23TZ%23JJH...@TK2MSFTNGP02.phx.gbl...
If I need to call 2 api's anyway...
BTW,
calling setlocaltime twice doesn't solve it...
I'm trying now to set a delay between those 2 calls, maybe it is related to
it.
This daylight saving is sometimes *#lsdqj2341%#$ !
I wonder if it saves as much as we think or maybe all these savings are
going to programmers like me that must handle
it... ;-)
Thanks.
Empi
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:uL5%23TZ%23JJH...@TK2MSFTNGP02.phx.gbl...
It takes time for the time service or the shell, depending on which version
of Windows CE we're talking about, to actually detect the adjustment,
calculate whether the new time should be DST or standard time, figure out if
that means a change from the current state of that flag and, if so, change
the clock by the right amount. There are various things that you might try:
delay, as you're doing now, detect the time server's call to change the time
and react to that, etc.
Ah, you live somewhere that it is used, huh? I live in Arizona, which long
ago decided that we have plenty of daylight, thank you very much. Our time
doesn't ever shift. I'm all in favor of dumping it.
Paul T.
"Empi" <mpe...@softstart.co.il> wrote in message
news:u7C6dWJ...@TK2MSFTNGP04.phx.gbl...
:-D
Thanks a lot.
Empi
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:u7%23CydJK...@TK2MSFTNGP05.phx.gbl...
Paul T.
"Empi" <mpe...@softstart.co.il> wrote in message
news:uOcBXiJ...@TK2MSFTNGP03.phx.gbl...