Task #94308
closedf:format.date should use $GLOBALS['EXEC_TIME'] instead of 'now'
100%
Description
The 'now' attribute in the DataTime-Object of PHP Function depends on the internal clock.
Two Viewhelper may show the different time like in this example
$first = new DateTime('now'); sleep(2); $second = new DateTime('now'); echo($first->format("Y-m-d H:i:s")); echo("\n"); echo($second->format("Y-m-d H:i:s"));
If the date-parameter is an empty string, TYPO3 should use $date = $GLOBALS['EXEC_TIME'] ?? time();
instead of $date = 'now';
.
If this is fixed, the documentation should changed, too.
Files
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New 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/+/72657
Updated by Gerrit Code Review almost 3 years 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/+/72678
Updated by Benni Mack almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1f9235cf0f9503d4cc9a0d169aec71e3d1526447.