Obligatory DateTime issues with C# - Determine if UtcNow is between given time span only
<p>I have a situation in which I need to set up a re-occuring time span (for this example, 6 PM - 6 AM is the span of time)</p>

<p>Date is not relevent to this. It is presumed to be a check every single day.</p>

<p>I am having trouble wrapping my head around how to do it because using <code>DateTime.UtcNow</code> does yield me the right time, but it does not yield the right day. However using <code>DateTime.MinValue</code> does not yield the current time. And I was not able to set the Date manually. I have explored the other posts on stack overflow, and I'm just misunderstanding something, I think.. but this is my paltry code at the moment...</p>

<pre><code>var start = DateTime.MinValue.Date.Add(new TimeSpan(18, 0, 0));
            var end = DateTime.MinValue.Date.Add(new TimeSpan(6, 0, 0));
            var timezone = TimeZone.CurrentTimeZone.GetUtcOffset(start);
            var now = DateTime.UtcNow;
            now.Date = DateTime.MinValue;

            // is right now greater than 6pm est?
            Console.WriteLine(start.TimeOfDay &lt; now);
            Console.WriteLine(end &lt; DateTime.UtcNow);
            Console.WriteLine(start.ToShortTimeString());
            Console.WriteLine(DateTime.UtcNow.TimeOfDay);
            Console.WriteLine(timezone.ToString());

            Console.ReadLine();
</code></pre>
