Project

General

Profile

Bug #98045

Updated by Jan Delius almost 2 years ago

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(): 
 <pre><code class="php"> 
 $this->context->setAspect('date', new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['EXEC_TIME']))); 
 </code></pre> 

 A proof-of-concept code that makes the aspect return the correct values: 
 <pre><code class="php"> 
 $dateTime = new \DateTime('@' . $GLOBALS['EXEC_TIME']); 
 
         $dateTime->setTimezone(new \DateTimeZone(date_default_timezone_get())); 
 
         $this->context->setAspect('date', new DateTimeAspect(\DateTimeImmutable::createFromMutable($dateTime))); 
 </code></pre> 

 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.

Back