Project

General

Profile

Actions

Feature #87935

closed

Use $_SERVER['REQUEST_TIME'] instead of time() for the current time in viewhelper f:date.format()

Added by Dieter Porth about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-03-16
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The Viewhelper f:date.format() use the time()-function, of PHP to get the current time.

$base = $arguments['base'] ?? time();

This line should be replaced by

$base = $arguments['base'] ?? $_SERVER['REQUEST_TIME'];

Reason:
$_SERVER['REQUEST_TIME'] contains the starttime of the request. Every call of a Dateviewhelper will use the same 'current time'.
If a user request a website at near midnight, two calls of time() can worstly generate two different dates with the f:format.date() viewhelper.

http://php.net/manual/en/function.time.php


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #82491: FluidStyledContent Header/Date.html Partial should respect config.locale_all typoscript setting for date format frontend outputClosedBenni Mack2017-09-15

Actions
Actions

Also available in: Atom PDF