Project

General

Profile

Actions

Bug #73637

closed

Epic #77562: Misbehaviors with datetime values and timezones

Extbase DateTimeConverter cannot handle negative timestamps

Added by Felix Althaus about 8 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2016-02-23
Due date:
% Done:

100%

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

Description

Using negative unix timestamp (signed integer, before unix epoch), \TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter fails to convert from timestamp to \DateTime.
This happens because \DateTime::createFromFormat('U', $timestamp) does not support negative timestamps.
\DateTime::__construct() as well as \DateTime::setTimestamp() do the job - though they treat timezones differently.

$date = new \DateTime('@' . $timestamp));

or
$date = (new \DateTime())->setTimestamp($timestamp);

The converter class seems to be intended somewhat independent of target type. That‘s why I‘m unsure both about how to write test and implementation.
Any suggestions?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #72053: Extbase: Support \DateTimeInterface instead of \DateTimeClosed2015-12-04

Actions
Actions #1

Updated by Felix Althaus about 8 years ago

Does #72053 (Extbase: Support \DateTimeInterface instead of \DateTime) need to be considered?

Actions #2

Updated by Mona Muzaffar almost 7 years ago

  • Related to Epic #80852: Datetime handling in backend added
Actions #3

Updated by Riccardo De Contardi almost 7 years ago

  • Parent task set to #77562
Actions #4

Updated by Riccardo De Contardi almost 7 years ago

  • Related to deleted (Epic #80852: Datetime handling in backend)
Actions #5

Updated by Benni Mack almost 4 years ago

  • Related to Feature #72053: Extbase: Support \DateTimeInterface instead of \DateTime added
Actions #6

Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

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

Actions #7

Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65821

Actions #8

Updated by Benni Mack over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF