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