[TYPO3-dev] serverTimeZone option isn't used in Core

Xavier Perseguers typo3 at perseguers.ch
Sat Nov 22 16:03:23 CET 2008


Hi,

Do I miss something or is this option 
($TYPO3_CONF_VARS['SYS']['serverTimeZone']) not used at all in Core?

If I write

tmp.lastUpdate = TEXT
tmp.lastUpdate {
     wrap = Last modification: |

     data = page:lastUpdated
     if.isTrue.data = page:lastUpdated
     strftime = %x %X
     data = register : SYS_LASTCHANGED
     if >
}

The comment for this setting is:

---
Integer, GMT offset of servers time (from time()). Default is "1" which 
is "GMT+1" (central european time). This value can be used in extensions 
that are GMT aware and wants to convert times to/from other timezones.
---

I think that the rendering should change whenever I change the value of 
serverTimeZone from 1 (default) to something else. But in 
class.tslib_content.php, this information is not used when rendering 
when using date() or strftime():

if ($conf['date']){$content=date($conf['date'], $content);}
if ($conf['strftime']){
     $content = strftime($conf['strftime'], $content);
     $tmp_charset = $conf['strftime.']['charset'] ? 
$conf['strftime.']['charset'] : $GLOBALS['TSFE']->localeCharset;
     if ($tmp_charset)       {
         $content = $GLOBALS['TSFE']->csConv($content,$tmp_charset);
     }
}

I think that those calls (and a few others too in Core, when dealing 
with PHP function time()) should add

+ 3600 * $TYPO3_CONF_VARS['SYS']['serverTimeZone']

to their timestamp. This means that the server should run UTC and not 
e.g., GMT+1. The best would be of course to be able to set the 
serverTimeZone (how the server itself is configured UTC or GMT+X) and 
then how the website should be rendered.

Let's give an example. You have your server in Switzerland and it's 
configured GMT+1 but you need to render pages for England (GMT+0). It 
would be really nice to write

$TYPO3_CONF_VARS['SYS']['serverTimeZone'] = '1';

and either in localconf:

$TYPO3_CONF_VARS['SYS']['siteTimeZone'] = '0';

or something like

config.renderTimeZone = 0

As such a change would impact existing installation, we may use the 
option Bernhard Kraft talked about on 
http://bugs.typo3.org/view.php?id=1697, namely 'respectTimeZone' and 
that does not exist at all, at least in 4.2.3.

What is your opinion on this problem?

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en




More information about the TYPO3-dev mailing list