title: C# how to check exact time difference in if condition
body: <p>I have this <code>if condition</code> where I need to do some stuff if the difference is 15 min or so</p>
  
  <pre><code>if (DateTime.UtcNow - x.Timestamp == TimeSpan.FromMinutes(15))
  {
      //Do something
  }
  </code></pre>
  
  <p>The above condition never satisfies when I check with <code>==</code> but when I do <code>&gt;=</code> it gets into the condition but that's not what I need, I want 15 min or so difference.</p>
  
  <p>Can someone explain this behavior? </p>
  
  <p>Sample Data:</p>
  
  <p>x = 2/17/2020 8:45:17 PM</p>