[TYPO3-dev] Datetime bug in 4.2 - SOLUTION

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sun Feb 24 13:57:58 CET 2008


bernd wilke schrieb:
> on Fri, 22 Feb 2008 16:33:09 +0200, Dmitry Dulepov [typo3] wrote:
> 
>> Hi!
>>
>> Martin Kutschker wrote:
>>> Ok, ok I didn't test it. But wasn't it the original idea to send UTC
>>> from the BE client to the server? If it were (this part seems to be
>>> broken), the server could change it into his TZ and store the time
>>> correctly. *
>> May be it was the idea. But the actual value sent, is the value of
>> localtime + user's time zone. And this value is stored in the database.
> 
> maybe you have to redefine the whole time-handling?
> 
> my idea on timehandling with different timezones and different editors 
> would be:
> 
> store UTC, but handle it client-specific. Which means on every display or 
> transmit there will be a calculation from or into UTC.

Exactly, though with one alteration. As TYPO3 now stores dates in local 
TZ this must be configurable for backwards compatibility. But this 
doesn't change much as on the server side it's no problem to convert 
times between local TZ and UTC.

> the BE-user might define his timezone in his BE-user-rec or by his 
> operating system: if he looks on a record he will be displayed the time 
> calculatetd in his timezone (calculated either from the server if he has 
> given a timezone in his BE-record, or by javascript if depending on his 
> OS). On editing this will be calculated backward from same instance.

Setting a free TZ on the client side may be a bit tricky but could be 
possible. Logical options for display/edit in the BE are server time (in 
case it is the same as the majority of the editors), UTC (same for all), 
local time and - your addition - a user definable time.

Note that for the cases of server time and definable time the offset has 
to be sent from the server to the client so that the client JS may do 
the correct handling (I assume that dates are always transferred in UTC).

> deciding wether data is shown or not can be calculated on a timezone-
> setting of the webserver given by the os or given in localconf.php
> (install-tool). Having the webserver as own client against the database.

I disagree on that part. As the storage format has to be defined by a 
setting I wouldn't treat server side scrips as "client" in the same 
sense as a browser is a "client".

Masi




More information about the TYPO3-dev mailing list