Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

Date Change event c# – The other way

leave a comment »

Could not find anything for change of date events in windows. Then after scraching my head lend up in following solution

DateTime dtTime = DateTime.Now;
DateTime dtTomorrow = DateTime.Today.AddDays(1);

long lng = (dtTomorrow.Ticks – dtTime.Ticks) / 10000;

timer1.Interval = (int)lng + 5000;

// here 5000 for next day + 5 sec. so putting it just for the case whenwe lagged in interval and may be date is not changed or so.

timer1.Start();

Advertisements

Written by Manish

April 3, 2007 at 10:54 am

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: