C# — Как можно сравнить время(DateTime)?
var periodFrom = new DateTime(2017, 10, 5, 11, 30, 0);
var periodTo = new DateTime(2017, 10, 5, 12, 30, 0);
var periodNow = DateTime.Now;
if (periodNow > periodFrom && periodNow < periodTo)
{
	Console.WriteLine("between");
}
	else
{
	Console.WriteLine("not between");
}

// 	timeFrom и timeTo выбирай вариант какой нужен
var timeFrom = periodFrom.TimeOfDay;
var timeTo = periodTo.TimeOfDay;

var timeFrom1 = new TimeSpan(11, 30, 0);
var timeTo1 = new TimeSpan(12, 30, 0);

var timeNow = DateTime.Now.TimeOfDay;
if (timeNow > timeFrom1 && timeNow < timeTo1)
{
	Console.WriteLine("between");
}
else
{
	Console.WriteLine("not between");
}
var periodFrom = new DateTime(2017, 10, 5, 11, 30, 0);
var periodTo = new DateTime(2017, 10, 5, 12, 30, 0);
var periodNow = DateTime.Now;
if (periodNow > periodFrom && periodNow < periodTo)
{
	Console.WriteLine("between");
}
	else
{
	Console.WriteLine("not between");
}

// 	timeFrom и timeTo выбирай вариант какой нужен
var timeFrom = periodFrom.TimeOfDay;
var timeTo = periodTo.TimeOfDay;

var timeFrom1 = new TimeSpan(11, 30, 0);
var timeTo1 = new TimeSpan(12, 30, 0);

var timeNow = DateTime.Now.TimeOfDay;
if (timeNow > timeFrom1 && timeNow < timeTo1)
{
	Console.WriteLine("between");
}
else
{
	Console.WriteLine("not between");
}