Ecto Query "ago" and "from_now"
Ecto.Query has 2 very useful functions for Datetime querying. Here's ago/2:
from p in Post, where: p.published_at > ago(3, "month")
And here's from_now/2
from a in Account, where: a.expires_at < from_now(3, "month")
And finally this is the list of intervals that it's supported:
- year
- month
- week
- day
- hour
- minute
- second
- millisecond
- microsecond