title: Querying by DateTime in Ecto
body: <p>Here is what I have tried.</p>
  
  <pre><code>date = Ecto.DateTime.from_erl(:calendar.universal_time())
  query |&gt; where([record], record.deadline &gt;= ^date)
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>date = Ecto.DateTime.from_erl(:calendar.universal_time())
  query = from m in MyApp.SomeModel,
        where: m.deadline &gt;= ^date,
        select: m
  </code></pre>
  
  <p>Both return same message</p>
  
  <pre><code>value `%Ecto.DateTime{..}` in `where` cannot be cast to type :datetime in query
  </code></pre>
  
  <p>From what I understand I am supposed to be using Ecto.DateTime in my queries. Maybe I am missing something obvious? Thanks!</p>