Answers.Body: <p>You were close, you can set a <code>postDate</code> param on your <code>craft.entries</code> criteria model. And the Twig filter <a href="http://twig.sensiolabs.org/doc/2.x/filters/date_modify.html" rel="noreferrer"><code>date_modify</code></a> helps you to get the DateTime from 12 months ago.</p>
  
  <pre><code>{% set timeAgo = now|date_modify('5:00 -12 months') %}
  {% set postDateParam = '&lt; ' ~ timeAgo|date('U') %}
  
  {% set entries = craft.entries.section('news').postDate(postDateParam) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-18T23:37:51.470Z
Answers.Text: Just to understand your code:  {% set timeAgo = now|date_modify('5:00 -12 months') %} sets timeAgo to now(5 o'clock) - 12 months  or what does the 5:00 stand for?
Answers.UserDisplayName: Rattikarl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-19T11:07:07.153Z
Answers.Text: Yes, exactly. Set the time to 5 a.m. then go back 12 months. This makes sure that the page changes once per day (at 5 a.m.). See PHP docs for all the possible relative time formats http://php.net/manual/en/datetime.formats.relative.php
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-16T22:34:57.490Z
Answers.LastActivityDate: 2017-02-16T22:41:41.947Z
Answers.LastEditDate: 2017-02-16T22:41:41.947Z
Answers.UserDisplayName: carlcs
Body: <p>I want to build an archive template where only entries older than 12 months show up.
  Is there an clean and easy way to do so? I only have strange calculations in mind.
  Something like this would be nice :)</p>
  
  <pre><code>{% for entry in craft.entries.section('news') if entry.postDate &gt; 12monthsago %}
  {% endfor %}
  </code></pre>
  
Tags: <templating><postdate>
Title: How to only show entries older than 12 months
ThreadText: # How to only show entries older than 12 months
  
  (Asked by: username_0 on 2017-02-16)
  
  I want to build an archive template where only entries older than 12 months show up.
  Is there an clean and easy way to do so? I only have strange calculations in mind.
  Something like this would be nice :)
  
  ```
  {% for entry in craft.entries.section('news') if entry.postDate > 12monthsago %}
  {% endfor %}
  
  ```
  
  **Tags:** templating, postdate
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-02-16. Score: 7 | Accepted answer
  
  You were close, you can set a `postDate` param on your `craft.entries` criteria model. And the Twig filter [`date_modify`](http://twig.sensiolabs.org/doc/2.x/filters/date_modify.html) helps you to get the DateTime from 12 months ago.
  
  ```
  {% set timeAgo = now|date_modify('5:00 -12 months') %}
  {% set postDateParam = '< ' ~ timeAgo|date('U') %}
  
  {% set entries = craft.entries.section('news').postDate(postDateParam) %}
  
  ```
  
  > **Comments:**
  > **username_0**: Just to understand your code:  {% set timeAgo = now|date_modify('5:00 -12 months') %} sets timeAgo to now(5 o'clock) - 12 months  or what does the 5:00 stand for?  
  > **username_1**: Yes, exactly. Set the time to 5 a.m. then go back 12 months. This makes sure that the page changes once per day (at 5 a.m.). See PHP docs for all the possible relative time formats http://php.net/manual/en/datetime.formats.relative.php  
  
  ---
  
  