Project

General

Profile

Actions

Bug #99627

closed

Context:class don't detect timezone correctly

Added by Dieter Porth almost 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-01-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I Define in the LocalConfiguration.php my timezone.
If I want to use the current timezone, I have to use the following code. The commented code will give back the timezone 'UTC'.

$context = GeneralUtility::makeInstance(Context::class);
$nowStamp = $context->getPropertyFromAspect('date','timestamp');
// $timeZone = $context->getPropertyFromAspect('date','timezone'); // TYPO3 bug
$timeZone = date_default_timezone_get();

Contains the Context:classs a bug?

P.S. I got the idea to use `date_default_timezone_get()` from the f:format.date-viewhelper, which didn`t use the context-class for detecting the timezone. It use the Context:class only for the detection of the current timestamp.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #103588: PreviewSimulator for time restricted pagesClosed2024-04-10

Actions
Related to TYPO3 Core - Bug #103690: Preview of page in the past (expired) throws exceptionClosed2024-04-20

Actions
Is duplicate of TYPO3 Core - Bug #98045: DateAspect->getTimezone (almost) never returns the correct valueClosedAndreas Wolf2022-07-28

Actions
Actions

Also available in: Atom PDF