string vrema_ot = "12:00";
string vrema_do = "18:00";
string vrema = "13:50";
Func<string, string, string, bool> CheckTime =(t1, t2, t3) =>{
int[] start = t1.Split(':').Select(x=>int.Parse(x)).ToArray();
int[] end = t2.Split(':').Select(x=>int.Parse(x)).ToArray();
int[] time = t3.Split(':').Select(x=>int.Parse(x)).ToArray();
var now = DateTime.Now;
var time_start = new DateTime(now.Year, now.Month, now.Day, start[0], start[1],0);
var time_end = new DateTime(now.Year, now.Month, now.Day, end[0], end[1],0);
var time_now = new DateTime(now.Year, now.Month, now.Day, time[0], time[1],0);
return time_now > time_start && time_now < time_end;
};
bool check = CheckTime(vrema_ot, vrema_do, vrema);
project.SendInfoToLog(string.Format("{0} > {1} && {0} < {2} == {3}", vrema, vrema_ot, vrema_do, check));
vrema = "19:50";
check = CheckTime(vrema_ot, vrema_do, vrema);
project.SendInfoToLog(string.Format("{0} > {1} && {0} < {2} == {3}", vrema, vrema_ot, vrema_do, check));
vrema = "12:00";
check = CheckTime(vrema_ot, vrema_do, vrema);
project.SendInfoToLog(string.Format("{0} > {1} && {0} < {2} == {3}", vrema, vrema_ot, vrema_do, check));
vrema = "17:59";
check = CheckTime(vrema_ot, vrema_do, vrema);
project.SendInfoToLog(string.Format("{0} > {1} && {0} < {2} == {3}", vrema, vrema_ot, vrema_do, check));
return check;