title: Check time is between two times
body: <p>I have a todo list in the database. Each Item has a todo item with a time by which it should be completed. What I want to do is have my C# application loop through the items and check if the item should've been completed an hour ago, at tops. Also the application must check if the item should be complete within the hour. If any of these two options is true, the job has to be shown to the user.</p>
  
  <p>How can I make this work? I thought of the way below, but that will show any item that should've been completed an hour ago, or more. I want the items that should've been completed already, with an maximum of 1 hour ago.</p>
  
  <pre><code>foreach (DataRow dr in dsValue.Tables[0].Rows)
  {
      DateTime dt = Convert.ToDateTime(dr["tijd"]);
  
      if (dt &gt; DateTime.Now.AddHours(-1) || dt &lt; DateTime.Now.AddHours(1))
      {
          MessageBox.Show(dr["opdracht"].ToString());
      }
  }
  </code></pre>