<p>Figured out a way to do this if anyone who has the same problem.</p>

<pre><code>    {% if year is defined and month is defined %}
    {% set archiveDate = year ~ '-' ~ month ~ '-01' %}
    &lt;h2 class='archive-title'&gt;Archive for {{ archiveDate|date('F') }} - {{ year }}&lt;/h2&gt;
    {% endif %}
</code></pre>

CC BY-SA 3.0
2014-10-01T21:46:08.757Z
2014-10-01T21:46:08.757Z
markstewie
<p>I've set up an archive page as described in the docs... so my archive page url looks something like this <code>http://mysite.dev/news/2014/09</code>. </p>

<p>How do I then make the title display <strong>Archive for September 2014</strong>?</p>

<p>The <code>{{ month }}</code> variable is set as 09 and doing this -> <code>{{ month|date("F") }}</code> outputs <strong>January</strong> not September.</p>

<p>Any help would be appreciated. </p>

<datetime><archives>
Showing the month on an archive page
# Showing the month on an archive page

(Asked by: username_0 on 2014-10-01)

I've set up an archive page as described in the docs... so my archive page url looks something like this `http://mysite.dev/news/2014/09`.

How do I then make the title display **Archive for September 2014**?

The `{{ month }}` variable is set as 09 and doing this -> `{{ month|date("F") }}` outputs **January** not September.

Any help would be appreciated.

**Tags:** datetime, archives


---

## 1 answers

### Answer by username_0 on 2014-10-01. Score: 7

Figured out a way to do this if anyone who has the same problem.
    {% if year is defined and month is defined %}
    {% set archiveDate = year ~ '-' ~ month ~ '-01' %}
    Archive for {{ archiveDate|date('F') }} - {{ year }}
    {% endif %}


---

