This isn't a timer issue. The timer has no concept of the current time.
It only knows that in a ^span^ of time, it has to fire.
Because of this, you will have to check the timer period every time it
is fired, and determine if the next day will result in a shift in the time
because of daylight savings.
A better solution would be to use the Windows Scheduler to run this
task. It can be configured to run at a certain time each day, and is not
affected by daylight savings. Because the OS updates the time automatically
for daylight savings, the scheduler, which is based on the system time, will
work correctly.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
<ch********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Is there any way to make a System.Timers.Timer adjust for daylight
savings time change? In a long running process I set a timer as follows
for a daily expiration:
_myTimer = new Timer(_myTimerDelegate, null, nextExpiration,
TimeSpan.FromDays(1));
When we make the change out of daylight time back to standard time, the
timer appears to fire one hour early (e.g., 4pm instead of 5pm). Is
there a way to set this timer so that it is daylight-time aware?
Thanks