Watch this example on YouTube
TimeSpan startSomething = new TimeSpan(8, 0, 0);
TimeSpan endSomething = new TimeSpan(16, 0, 0);
TimeSpan now = DateTime.Now.TimeOfDay;
if ((now > startSomething) && (now < endSomething))
{
//do something here
}
No comments:
Post a Comment