L
Lothar Behrens
Hi,
I played with the following code in my project and figured out that
when the application is not restarted and I change the date from
26.01.2011 to 20.07.2011 the code does not change the label to
indicate summer time.
Only after I restart the application, the change is recognized.
Why does this not work while the application keeps running?
private void button1_Click(object sender, EventArgs e)
{
if (DateTime.Now.IsDaylightSavingTime())
label1.Text = "It is daylight saving time";
else
label1.Text = "It is not daylight saving time";
}
Thanks,
Lothar
I played with the following code in my project and figured out that
when the application is not restarted and I change the date from
26.01.2011 to 20.07.2011 the code does not change the label to
indicate summer time.
Only after I restart the application, the change is recognized.
Why does this not work while the application keeps running?
private void button1_Click(object sender, EventArgs e)
{
if (DateTime.Now.IsDaylightSavingTime())
label1.Text = "It is daylight saving time";
else
label1.Text = "It is not daylight saving time";
}
Thanks,
Lothar