[TYPO3-core] RFC #7626: Date/time handling is completely broken in 4.2

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sun Feb 24 18:35:06 CET 2008


Steffen Kamper schrieb:
> "Steffen Kamper" <steffen at sk-typo3.de> schrieb im Newsbeitrag 
> news:mailman.1.1203858793.4788.typo3-team-core at lists.netfielders.de...
> 
>> there is one problem left. When you enter date in a datefield in my case 
>> the
>> date moves backward one day, because it's subtract 2 hours from midnight. 
>> I
>> will look how to prevent any time conversion with date(only) fields.
>>
>> vg  Steffen
>>
> 
> i solved this problem with attached patch.
> I completely removed UTC for dates. Only with times it is used for offset 
> calculation.

Yeu set the server TZ in bakend.php (=> frame "_top"). Please keep in 
mind that alt_doc.php may open in a popup and has no "top". IIRC much JS 
code is duplicated in alt_main.php and alt_doc.php for that reason. 
Maybe we could change all "top.property" to "mainWin.property" and 
define this like that "mainWin = top ? top : opener;"

Anyway, this cannot be right:

$d = date('O'); // ±HHMM
$minutes = substr($d,1,2)*60 + substr($d,3,2);
$serverTimezoneOffset = intval(substr($d,0,1) + $minutes);

For minutes you don't use intval and rely on implict type conversion, 
OTOH you do an intval on the addition of the *sign* and the minutes. It 
has to be a either a * (integer multiplication) or a . (string 
concatenation).

Just in case this is the right fix. Can you change the variable names or 
add some documentation that makes some sense? I'm still unhappy with 
that lastTime thingy.

Masi


More information about the TYPO3-team-core mailing list