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

Steffen Kamper steffen at sk-typo3.de
Sun Feb 24 00:51:55 CET 2008


I debugged the JS to see what happens.

Result is that JS does wrong calculation.
what i tried:
server: UTC +1
client:  UTC +3

Input: 22:00 24-2-2008
Result: 23:00 24-2-2008

JS uses the timeoffset:
theTime.setTime((this.lastTime - theTime.getTimezoneOffset()*60)*1000);

theTime.getTimezoneOffset() is -180, so you see that calculation is wrong.
transfered time is: 22:00

Server thinks he get an UTC and adds 1 hour (UTC +1)

The fatal and breaking point is, that server adds this one hoer everytime 
you save the form, independent of your change in this field, so this can't 
work.

To get a right result JS calculation should only used when the value of the 
field change, and then it should be converted to servers timezone, server 
should save this as it is.
With server timezone it's possible to display the date in any timezone.

So the missing part for this is a var in JS with the servers timezone (or 
offset) and the differing (general eval or filed change (or on lost focus)

vg  Steffen 




More information about the TYPO3-team-core mailing list