Project

General

Profile

Actions

Bug #77563

closed

Epic #77562: Misbehaviors with datetime values and timezones

Native DBMS datetime columns are not handled correctly

Added by Oliver Hader over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2016-08-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Native datetime fields (having TCA property dbType set) are not handled correctly when being persisted. The assumption that all date values are stored for UTC timezone (like it is for integer timestamps) is not correct here.

Given that the editor is currently in CEST (+02:00) and enters the datetime value "2016-09-01 09:30:00" this currently results in exactly this value being persisted - however the correct value would be "2016-09-01 07:30:00", which is sanitized by the timezone offset of 2 hours for CEST.

The datetime lifecycles:
  • DataHandler receives a timestamp for local timezone from backend forms
  • DataHandler converts timestamp to UTC by removing timezone offset
  • DataHandler persists changes to database
    • for regular integer timestamps that correct
    • for dbType datetime values, it's serialized to a string using date - which adds the timezone again - gmdate would be correct
  • BackendUtility reads from database
  • BackendUtility converts dbType datetime values using strftime - however should add the timezone offset again, if previously processed with gmtime
  • Extbase treats the datetime values as UTC and add the timezone offset - which results in an unexpected and wrong addition to the time
Actions #1

Updated by Oliver Hader over 7 years ago

  • Description updated (diff)
Actions #2

Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49527

Actions #3

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49526

Actions #4

Updated by Oliver Hader about 7 years ago

  • Status changed from Under Review to Closed

Handled by ISO dates in master...

Actions

Also available in: Atom PDF