[TYPO3-mvc] f:format.date timezone "problem"?

Simon Schaufelberger schaufelREMOVE-MEberger at punkt.de
Thu Apr 28 18:06:45 CEST 2011


Hi,
Using TYPO3 4.5.2 on a linux machine in Germany with PHP 5.2 and the 
following settings in the install tool:

$TYPO3_CONF_VARS['SYS']['phpTimeZone'] = 'Europe/Berlin';
$TYPO3_CONF_VARS['SYS']['serverTimeZone'] = '2';

this STILL does not work for me.
I know that it is only possiblt to set the timezone with PHP 5.3 but 
what about the serverTimeZone variable?

When calling this directly in a php file, i get the correct output:

<?php

function render($date = NULL, $format = 'Y-m-d') {
	if ($date === NULL) {
		echo "render children";
		if ($date === NULL) {
			return '';
		}
	}
	if (!$date instanceof DateTime) {
		try {
			$date = new DateTime($date);
		} catch (Exception $exception) {
			echo "error";
		}
	}
	return $date->format($format);
}
	
echo render('2011-04-27 00:00:00', 'd.m.Y')	
?>

When calling the same via fluid helper, i get the wrong result 
(26.4.2011) so what is going on in fluid/extbase here?

The input into the fluid template is a string: '2011-04-29 00:00:00' and 
not an object.

Am 30.07.2010 09:38, schrieb Christian Zenker:
> After having a look at the code it seems there is nothing left to do.
> Extbase already maps a date correctly to a DateTime object.
> It is done by using date() on the timestamp and letting the DateTime
> constructor parse the result. This way the timezone is set too.
>
> Christian.

-- 
Kind regards,

Schaufi from punkt.de


More information about the TYPO3-project-typo3v4mvc mailing list