title: Compare datetime column just year (without time-day-month) with Linq
body: <p>I want to get a 2022 records. But my code is not efficient. How to compare it?</p>
  <pre><code>&gt; var _year = &quot;2022&quot;; list= query.Where(x =&gt;
  &gt; Convert.ToDateTime(x.created_time).ToString(&quot;YYYY&quot;).Equals(_year
  &gt; )).ToList();
  
                   
  </code></pre>