Format date without translating text Is there a simple way to opt out of the translation that occurs when you format a date like this:

{{ expiry | date('D, d M Y H:i:s', 'GMT') }}


The problem is that I need this in english to create a valid date for my HTTP headers. But the site is in norwegian so days and months are translated, resulting in an invalid date.
Not currently - we should probably add a new 'translate' argument to that function which would let you opt out of it.

However Craft’s DateTime variables have a rfc1123() function which can be used instead of the Twig |date filter, and its output won’t get automatically translated.

For reference, RFC 1123 defines the date/time specification recommended by RFC 2616 (HTTP 1.1) (which is the same as the one defined by RFC 822, just with 4-digit years).

{{ expiry.rfc1123() }}