I had written one windows service in C#.NET which fires on every miniutes… I want to fire a mail to my manager in every month on say xyz date…. this task shld repeted on every month on same date… So can any one tell me how to do this..? I mean to say the block of code which i will write shld get executed on same date of every month…
Share
This will give you a TimeSpan of the number of days/hours/minutes/etc. until the first day of the next month:
Use
DateTime.Todayfor midnight of the first day of next month.You can use that to set the interval for a timer.