2

I am maintaining a bilingual Drupal 6 site with German being default language and English as secondary. The site offers an RSS feed of German articles. This RSS feed is generated with Views and Views RSS. One of the displayed fields in the feed is the creation date which is in custom format "D, d M Y H:i:s O" for rss clients. The date is always shown in German, i.e. "Mi, 08 Mär 2012 13:44:27 +0200" but I'd like to have this field using English standard, i.e. "Wed, 08 Mar 2012 13:44:27 +0200".

Any idea how I could achieve that?

The feed url is sth. like domain.com/feed (German). If I use the English url domain.com/en/feed, all the date fields are in English format but then the content urls also link to the English version (e.g. domain.com/en/node/123 instead of domain.com/clean-german-url).

Thanks in advance, Paul

0

I found a solution.

First, I installed an additional module (Views PHP). This module provides a PHP field to be used in Views. This field has access to the retrieved data from other fields. Its value I set to

<?php
  print date('D, d M Y H:i:s O',$data->pubDate);
?>

and in Views RSS items fields I set the pubDate value to this Custom PHP field instead of the Date field (Node creation). Since PHP are not translated by default, the value displayed in the feed is in English while the URLs still have the German format.

0

I found an even easier solution, with a Custom date format simply use r, which is RFC 2822

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.