Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Condition based on day

Status
Not open for further replies.
Mar 20, 2003
103
0
0
AU
I got a c# application that on the 1st of every month it will be run and left on until the 5th of every month.

I need the application to check the days between the 1st and the 5th whether it is a weekend or not. If it is a weekend the application will not process anything but will still be on. How do I do this?
 
this might work, haven't tested it.
Code:
if (DateTime.Now.DayOfWeek == (DayOfWeek.Saturday || DayOfWeek.Sunday))
{
     // Party time
}
else
{
     // get back to work
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top