[TYPO3-core] RFC: bug #7897: Datetime saving across DST switches shifts time

Steffen Kamper steffen at sk-typo3.de
Wed Apr 2 15:11:37 CEST 2008


"Ernesto Baschny [cron IT]" <ernst at cron-it.de> schrieb im Newsbeitrag 
news:mailman.1.1207133843.5049.typo3-team-core at lists.netfielders.de...
> This is a SVN patch request.
>
> Problem:
> On fields of type "datetime" and "date", if you set a date in future or
> past that is in a different DST (daylight saving time) condition than
> your browser currently is (either you are in DST and the date you want
> to set is not, or the other way around), the stored date (displayed in
> the List-view) is different from the date displayed in the BE-edit form.
>
> It is shifted by 1 hour or by 1 day, e.g if you are in DST and the date
> you want to set is not in DST.
>
>
> Solution:
> When storing and handling the time information in javascript and in
> outputting it we currently normalize the information to UTC-time. The
> bug was that we were assuming the the offset to UTC is always the same.
> This is of course wrong: When client switches to DST the offset to UTC
> either grows or shrinks by 60 minutes. So to calculate the UTC time, we
> need to get the "offset to UTC" of the date we are trying to store and
> not use "today" as a base of the calculation.
>
> The change has to be done on server side (server converting stored local
> time to UTC time) and on client side (javascript converting local input
> date to UTC time). Attached patch does that.
>
>
> Branches: TYPO3_4-2  (critical bug!!)
>
>
> Bugtracker reference:
> http://bugs.typo3.org/view.php?id=7897
>

+1 by testing - all is correct shown now. Big thanks for taking care!

vg Steffen 




More information about the TYPO3-team-core mailing list