Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is probably with the locale settings. It's unable to translate the month "okt" (should be "oct" in English), but was working fine with "sep" (same in English). The <code>strtotime()</code> function only works in English but explains why it was working a few days ago, but not now.</p> <p>You have three options:</p> <ol> <li><p>You can fix the way dates are generated with strtotime using <a href="http://php.net/manual/en/function.setlocale.php" rel="nofollow"><code>setlocale()</code></a>. You need this in your RSS class, set the locale to English and output the dates.</p></li> <li><p>Use <a href="http://php.net/manual/en/datetime.createfromformat.php" rel="nofollow"><code>CreateFromFormat()</code></a> when reading the string, in conjunction with <code>SetLocale</code> when reading the date. You should be able to translate a foreign date.</p></li> <li><p>Manually parse the date yourself. <code>Preg_match()</code> could be a good starter for that.</p></li> </ol> <p>Option 1 is probably easiest, if you can.</p> <hr> <p>Edit (based on comments and edited question)</p> <p>As the item data is coming straight from the rss feed (and is not self-generated) then you're probably up for option 3 (manually parse the string yourself). As you're ignoring the days of the week, the only bit you need to convert is the month, so use str_replace:</p> <pre><code>foreach($items as $index =&gt; $item) { $pubdateForeignString = substr($item['pubDate'], 4); $pubdateEnglishString = str_replace(array('mai', 'okt', 'dez'), array('may', 'oct', 'dec'), $pubdateForeignString); $pubdate = date("Y-m-d", strtotime($pubdateEnglishString)); </code></pre> <p>You only need to convert the months that are different - I've taken a stab at German, but if in doubt you could use date('M') in a loop with setlocale().</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload