Actions
Bug #99627
closedContext:class don't detect timezone correctly
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.
Actions