Issue Task Closed

#94308f:format.date should use $GLOBALS['EXEC_TIME'] instead of 'now'

Dieter Porth 06/11/21, 08:04 updated 10/04/22, 14:11

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.

Reviews 2

Files 1

History 24

  1. Gerrit Code Review pushed patch set 1 for main to change 72657 status New Under Review 12/14/21, 14:39

  2. Gerrit Code Review pushed patch set 1 for 11.5 to change 72678 12/15/21, 15:36

  3. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % 12/15/21, 15:40

    Applied in changeset commit:1f9235cf0f9503d4cc9a0d169aec71e3d1526447.

  4. Benni Mack changed status Resolved Closed 10/04/22, 14:11