Bug #98045
closedDateAspect->getTimezone (almost) never returns the correct value
100%
Description
On the way the DateTimeAspect is initiated, there is never an evaluation of the current time zone. Thus the aspect always returns only the time zone "+00:00". Also the ISO date is always given in UTC instead of the currently set server time zone.
An example of this is given in the method TYPO3\CMS\Frontend\Http\Application::initializeContext():
$this->context->setAspect('date', new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])));
A proof-of-concept code that makes the aspect return the correct values:
$dateTime = new \DateTime('@' . $GLOBALS['EXEC_TIME']);
$dateTime->setTimezone(new \DateTimeZone(date_default_timezone_get()));
$this->context->setAspect('date', new DateTimeAspect(\DateTimeImmutable::createFromMutable($dateTime)));
This aspect is created in several places in the TYPO3 core. The value of date_default_timezone_get()
is already defined beforehand by TYPO3 (if required) and should thus be able to be taken.
Apparently this bug has been present since the existence of the aspects until the current branch of the 12 version.
Updated by Andreas Kienast over 1 year ago
- Sprint Focus set to On Location Sprint
Updated by Oliver Hader over 1 year ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Felix Nagel over 1 year ago
Can confirm this issue for TYPO3 11.5.21.
Updated by Jan Delius about 1 year ago
- Has duplicate Bug #99627: Context:class don't detect timezone correctly added
Updated by Andreas Wolf 5 months ago
- Status changed from New to In Progress
- Assignee set to Andreas Wolf
Updated by Gerrit Code Review 5 months ago
- Status changed from In Progress to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 3 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 3 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review about 2 months ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 27 days ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 27 days ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 27 days ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 27 days ago
Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 24 days ago
Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 24 days ago
Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 21 days ago
Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 20 days ago
Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 20 days ago
Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 20 days ago
Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 19 days ago
Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
Updated by Gerrit Code Review 18 days ago
Patch set 1 for branch 12.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/+/83682
Updated by Gerrit Code Review 18 days ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83684
Updated by Markus Klein 18 days ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5079949f3625bf0c9201f71e6878f925ccfdad50.
Updated by Georg Ringer 14 days ago
- Related to Bug #103588: PreviewSimulator for time restricted pages added
Updated by Stefan Bürk 4 days ago
- Related to Bug #103690: Preview of page in the past (expired) throws exception added