TimeSpan startTime
= new TimeSpan(9, 0, 0);
TimeSpan endTime = new TimeSpan(18, 0, 0);
TimeSpan now = DateTime.Now.TimeOfDay;
//TimeSpan now = new TimeSpan(0, 0, 0);
if (now >= startTime || end <= endTime)
{
// Your code here..
}
Note:-
Time is calculate in 24-hour format
No comments:
Post a Comment