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.



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: Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: