Query entries posted in the past month I’m trying to show only entries for the created in the last month. I’ve taken this from the example in the docs but it ends up showing nothing. There’s 100% entries with a postDate in the last month.
What am I missing?
{% set start = now|date_modify(&quot;-1 month&quot;)|date('Y-m-d') %}
{% set end = now|date('Y-m-d') %}

{% set newsQuery = craft.entries({
    section: 'news',
    postDate: ['and', &quot;&gt;= #{start}&quot;, &quot;&lt; #{end}&quot;],
}) %}

Thanks!
Immediately found a solution!
{% set newsQuery = craft.entries({
    section: 'news',
    after: now|date_modify('0:00 -1 months'),
}) %}