<p>I decided to do the translation in the template itself. So if the local is in Dutch but I want to use English:</p>

<pre><code>{% set dag = now|date('l' ) %}    
{% set maand = now|date('F' ) %}                                  
{% switch dag %}
    {% case "maandag" %}
       {% set EnDag = 'Monday' %}
    {% case "dinsdag" %}
        {% set EnDag = 'Tuesday' %}
    {% case "woensdag" %}
        {% set EnDag = 'Wednesday' %}
    {% case "donderdag" %}
        {% set EnDag = 'Thursday' %}
    {% case "vrijdag" %}
        {% set EnDag = 'Friday' %}
    {% case "zaterdag" %}
        {% set EnDag = 'Saturday' %}
    {% case "zondag" %}
        {% set EnDag = 'Sunday' %}
{% endswitch %}
 {% switch maand %}
    {% case "januari" %}
       {% set EnMaand = 'January' %}
    {% case "februari" %}
        {% set EnMaand = 'February' %}
    {% case "maart" %}
        {% set EnMaand = 'March' %}
    {% case "april" %}
        {% set EnMaand = 'April' %}
    {% case "mei" %}
        {% set EnMaand = 'May' %}
    {% case "juni" %}
        {% set EnMaand = 'June' %}
    {% case "juli" %}
        {% set EnMaand = 'July' %}
    {% case "augustus" %}
        {% set EnMaand = 'August' %}
    {% case "september" %}
        {% set EnMaand = 'September' %}
    {% case "oktober" %}
        {% set EnMaand = 'October' %}
    {% case "november" %}
        {% set EnMaand = 'November' %}
    {% case "december" %}
        {% set EnMaand = 'December' %}
{% endswitch %}                                       
{# output the day #}
{{EnDag}}, {{EnMaand}} {{day.date.format('j, Y')}}
</code></pre>

CC BY-SA 3.0
2017-01-02T11:41:16.507Z
2017-01-02T14:38:52.000Z
2017-01-02T14:38:52.000Z
noregt
<p>The Craft/Twig <a href="https://craftcms.com/classreference/etc/templating/twigextensions/CraftTwigExtension#dateFilter-detail" rel="nofollow noreferrer">dateFilter</a> that you're using will currently only translate the string into the current locale the site is set to.</p>

<p>You could probably write a <a href="https://pluginfactory.io" rel="nofollow noreferrer">plugin</a> that added its own Twig Extension that added its own filter... let's call it <code>|translatedDate</code> and you could pass in the target locale code as a parameter <code>|translatedDate('en_us')</code>.</p>

<p>That filter would do something like:</p>

<pre><code>$currentLanguage = craft()-&gt;getLanguage();
craft()-&gt;setLanguage('en_us');
...
// Do logic similar to Craft's existing date filter
...
craft()-&gt;setLanguage($currentLanguage);
</code></pre>

CC BY-SA 3.0
2017-01-02T11:43:11.123Z
Thanks Brad, I started with the plugin, but with my next level php skills ;-) eventually decided to just pickup the local date and translate that in the template (see underneath)
noregt
CC BY-SA 3.0
2016-12-30T18:28:32.893Z
2016-12-30T18:28:32.893Z
Brad Bell
<p>I'm trying to output a date like this for instance:</p>

<pre><code>{{ now|date('l, j-m-Y') }}
</code></pre>

<p>This outputs the date in my standard language. I need it output on the same page in English too. Is this possible?</p>

<datetime><language>
Output two date languages on the same page without localization
# Output two date languages on the same page without localization

(Asked by: username_0 on 2016-12-30)

I'm trying to output a date like this for instance:
{{ now|date('l, j-m-Y') }}

This outputs the date in my standard language. I need it output on the same page in English too. Is this possible?

**Tags:** datetime, language

---

## 2 answers

### Answer by username_0 on 2017-01-02. Score: 1 | Accepted answer

I decided to do the translation in the template itself. So if the local is in Dutch but I want to use English:
{% set dag = now|date('l' ) %}    
{% set maand = now|date('F' ) %}                                  
{% switch dag %}
    {% case "maandag" %}
       {% set EnDag = 'Monday' %}
    {% case "dinsdag" %}
        {% set EnDag = 'Tuesday' %}
    {% case "woensdag" %}
        {% set EnDag = 'Wednesday' %}
    {% case "donderdag" %}
        {% set EnDag = 'Thursday' %}
    {% case "vrijdag" %}
        {% set EnDag = 'Friday' %}
    {% case "zaterdag" %}
        {% set EnDag = 'Saturday' %}
    {% case "zondag" %}
        {% set EnDag = 'Sunday' %}
{% endswitch %}
 {% switch maand %}
    {% case "januari" %}
       {% set EnMaand = 'January' %}
    {% case "februari" %}
        {% set EnMaand = 'February' %}
    {% case "maart" %}
        {% set EnMaand = 'March' %}
    {% case "april" %}
        {% set EnMaand = 'April' %}
    {% case "mei" %}
        {% set EnMaand = 'May' %}
    {% case "juni" %}
        {% set EnMaand = 'June' %}
    {% case "juli" %}
        {% set EnMaand = 'July' %}
    {% case "augustus" %}
        {% set EnMaand = 'August' %}
    {% case "september" %}
        {% set EnMaand = 'September' %}
    {% case "oktober" %}
        {% set EnMaand = 'October' %}
    {% case "november" %}
        {% set EnMaand = 'November' %}
    {% case "december" %}
        {% set EnMaand = 'December' %}
{% endswitch %}                                       
{# output the day #}
{{EnDag}}, {{EnMaand}} {{day.date.format('j, Y')}}


---

### Answer by username_1 on 2016-12-30. Score: 2

The Craft/Twig dateFilter that you're using will currently only translate the string into the current locale the site is set to.
You could probably write a plugin that added its own Twig Extension that added its own filter... let's call it |translatedDate and you could pass in the target locale code as a parameter |translatedDate('en_us').
That filter would do something like:
$currentLanguage = craft()->getLanguage();
craft()->setLanguage('en_us');
...
// Do logic similar to Craft's existing date filter
...
craft()->setLanguage($currentLanguage);

> **Comments:**
> **username_0**: Thanks Brad, I started with the plugin, but with my next level php skills ;-) eventually decided to just pickup the local date and translate that in the template (see underneath)  

---

