[TYPO3-english] problem with External Data Import ext

Xavier Perseguers xavier.perseguers at typo3.org
Wed Mar 16 15:47:47 CET 2011


Hi,

> btw my $TYPO3_CONF_VARS['SYS']['serverTimeZone']  is set to 1, shall I
> change it to something else? Which are the possibilities?

With serverTimeZone = 1 you set your timezone to GMT+1. A Unix timestamp 
has no timezone support (that's was an issue with the Fluid date 
viewhelper at the beginning btw). With GMT+1, the timestamp you put in 
the DB should take this into account and be modified accordingly. Just 
add/subtract the serverTimeZone number of hours before storing and TYPO3 
should be happy and show you the "correct" date/hour.

For instance here is how to get a valid DateTime object out of a 
timestamp (coming from TYPO3 DB). It takes the php.ini timezone setting 
but you may of course take serverTimeZone into account instead.

$dateTime = new DateTime('@' . $this->lastModificationDate);
$dateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
return $dateTime;

HTH

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-english mailing list