title: how to convert UTC dateTime to local datetime
body: <p>I have problem with my search range function because we store UTC dateTime in database.for example user store record and it's after midnight in UTC time zone record stamped ex "2015-06-23 01:05:34".  my search range function will get wrong list of result because of UTC. I tried to convert datetime  to local time in linq using .ToLocalTime() using I have this error </p>
  
  <blockquote>
    <p>"LINQ to Entities does not recognize the method 'System.DateTime
    ToLocalTime()' method, and this method cannot be translated into a
    store expression." </p>
  </blockquote>
  
  <p>just I want to ask how to convert utc datetime to local datetime in EF?</p>
  
  <pre><code>  var rrnForms = (from rrn in db.RrnForms
                              where
                                  (DbFunctions.TruncateTime(rrn.RrnVisitPhoneDate) &gt;= fromDateSearch.Date &amp;&amp;
                                   DbFunctions.TruncateTime(rrn.RrnVisitPhoneDate) &lt;= toDateSearch.Date)
                              select rrn).ToList();
  </code></pre>