<p>I used the <code>after</code> parameter in my query.</p>

<pre><code>{% set query = craft.entries({
    after: now|date_modify('5:00 -12 months')
}).all() %}
</code></pre>

<p>I'm grabbing todays date, then modifying with the <code>date_modify</code> filter. The <code>5:00</code> string makes sure it changes at the same time everyday. </p>

<p>I got the usage of <code>date_modify</code> from carlcs's answer here: <a href="https://craftcms.stackexchange.com/questions/19023/how-to-only-show-entries-older-than-12-months">How to only show entries older than 12 months</a></p>

CC BY-SA 4.0
2018-10-20T20:52:44.093Z
2018-10-20T20:52:44.093Z
Jeff Irwin
<p>I need to display entries from the past 12 months. I'd like to create an entry query and set the timeframe of the entries I need.</p>

<entry><query><queries>
How to show entires from past 12 months?
# How to show entires from past 12 months?

(Asked by: username_0 on 2018-10-20)

I need to display entries from the past 12 months. I'd like to create an entry query and set the timeframe of the entries I need.

**Tags:** entry, query, queries

---

## 1 answers

### Answer by username_0 on 2018-10-20. Score: 2

I used the after parameter in my query.
{% set query = craft.entries({
    after: now|date_modify('5:00 -12 months')
}).all() %}

I'm grabbing todays date, then modifying with the date_modify filter. The 5:00 string makes sure it changes at the same time everyday. 
I got the usage of date_modify from carlcs's answer here: How to only show entries older than 12 months


---

