Answers.Body: <p>Twig’s <code>date</code> filter is aware of the current Craft locale, so you should be able to create a DateTime after composing a string that the filter accepts (see PHP <a href="http://www.php.net/en/strtotime" rel="nofollow noreferrer"><code>strtotime</code> function</a> docs, which the filter uses behind the scenes).</p>
  
  <pre><code>{% set day = 1 %}
  {% set month = 'juni' %}
  {% set year = 2016 %}
  
  {% set dateString = [day, month, year]|join(' ') %}
  {% set date = dateString|date %}
  
  {{ date }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-15T02:20:19.960Z
Answers.LastActivityDate: 2017-02-15T02:39:40.207Z
Answers.LastEditDate: 2017-02-15T02:39:40.207Z
Answers.UserDisplayName: carlcs
Body: <p>I've got News Archive pages that display all entries posted in a certain month/year. For example June 2016 shows all entries created in June of 2016!</p>
  
  <p>I'm fetching the entries based on <code>craft.request.segment</code> (as the URL ends in /june/2016 etc). This works great for all English months, but when my URL says /juni/2016 (the German month name) it can't find any entries??</p>
  
  <pre><code>{% set month = craft.request.segment(2) %}
  {% set year = craft.request.segment(3) %}
  </code></pre>
  
  <p>It's defintely a translation thing. Anyone know how <code>craft.request.segment</code> can work with locales (German and simplified Chinese) too?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-15T02:18:09.050Z
Comments.Text: Does your URI structure change for German so that it's in a different segment?  i.e. site.com/de/archives/juni/2016 vs. site.com/archives/june/2016?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-15T02:19:05.717Z
Comments.Text: Sorry, I was just about to answer this question myself. See #help channel in Slack! ;-)
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-15T02:22:18.213Z
Comments.Text: lol - of course.  i'd expect nothing less from you. :)
Comments.UserDisplayName: Brad Bell
Tags: <templating><localization><datetime>
Title: Archive pages with full month names?
ThreadText: # Archive pages with full month names?
  
  (Asked by: username_0 on 2017-02-15)
  
  I've got News Archive pages that display all entries posted in a certain month/year. For example June 2016 shows all entries created in June of 2016!
  
  I'm fetching the entries based on `craft.request.segment` (as the URL ends in /june/2016 etc). This works great for all English months, but when my URL says /juni/2016 (the German month name) it can't find any entries??
  
  ```
  {% set month = craft.request.segment(2) %}
  {% set year = craft.request.segment(3) %}
  
  ```
  
  It's defintely a translation thing. Anyone know how `craft.request.segment` can work with locales (German and simplified Chinese) too?
  
  **Tags:** templating, localization, datetime
  
  > **Comments:**
  > **username_1**: Does your URI structure change for German so that it's in a different segment?  i.e. site.com/de/archives/juni/2016 vs. site.com/archives/june/2016?  
  > **username_0**: Sorry, I was just about to answer this question myself. See #help channel in Slack! ;-)  
  > **username_1**: lol - of course.  i'd expect nothing less from you. :)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-02-15. Score: 1 | Accepted answer
  
  Twig’s `date` filter is aware of the current Craft locale, so you should be able to create a DateTime after composing a string that the filter accepts (see PHP [`strtotime` function](http://www.php.net/en/strtotime) docs, which the filter uses behind the scenes).
  
  ```
  {% set day = 1 %}
  {% set month = 'juni' %}
  {% set year = 2016 %}
  
  {% set dateString = [day, month, year]|join(' ') %}
  {% set date = dateString|date %}
  
  {{ date }}
  
  ```
  
  
  ---
  
  