0

I have 2 servers which I though were synchronized (dev and live) but the "News System" (extension key "news") makes something different.

In the dev server this line

<f:format.date format="%A">{newsItem.datetime}</f:format.date>

outputs "Freitag", as expected (Thats friday in German)

But in the Live Server, it outputs %AM. Which is even weirder is that l (alone, without %) outputs "Friday" in English.

I've checked all the configurations I've seen and I cant seem to find where the difference between the systems is.

Any idea?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189

2 Answers2

0

TYPO3 is using DateTime::format (http://de2.php.net/manual/en/datetime.format.php) to format the date. This method is using the same syntax of date() which is not using locales, so all output is english.

The only thing I can not explain is why your dev enviroment accepts %A to render the date. Are there different PHP-Versions? Which TYPO3 Version are you using? Get a look at /typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php, you will get the answer there.

Merec
  • 2,751
  • 1
  • 14
  • 21
  • The only "significative" difference I see is that one working wekk is is TYPO3 4.7.9, and the other is 4.7.7, but thats unlikely to be the issue, no? – Enrique Moreno Tent Mar 18 '13 at 15:38
  • Well then read the php manual http://de2.php.net/manual/en/function.date.php what what displays. I have added a separate ViewHelper to display dates via strftime. – Merec Mar 18 '13 at 17:11
  • I know what what displays. The problem is I dont know why it behaves differently... – Enrique Moreno Tent Mar 20 '13 at 08:22
  • Fact is that this method will never return localized strings like "Freitag" so your development system returns wrong values. Check your PHP instllations, create a file and insert "phpinfo()" and then compare all versions. – Merec Mar 20 '13 at 08:30
  • I have compared them and they are identical in most values. None which seems to be of relevance to me. – Enrique Moreno Tent Mar 20 '13 at 08:49
0

I just solved it! Turns out I had 4.7.7 in my live server, and that doesnt support stftime.

Funny, I never thought that such an important feature would be added in an 4.7.X update...

Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189