Project

General

Profile

Actions

Bug #77935

closed

time field in TCA is rendered in FE with an excess of 1 hour

Added by Jérémie Roulin over 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-09-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi there,

I have a time field in backend (see TCA configuration for it bellow) and if I choose for example 10:00 it renders 11:00 in FE. Data is stored as timestamp in the database and I use FormatDateViehelper to render it.

TCA configuration :

        'finish_time' => [
            'label' => 'Finish time',
            'config' => [
                'type' => 'input',
                'size' => 8,
                'max' => 20,
                'eval' => 'time',
                'default' => 3600
            ]
        ],

ext_tables.sql entry :

CREATE TABLE tx_myext_domain_model_mymodel (
    finish_date int(11) unsigned DEFAULT '0' NOT NULL,
);

Model :

    /**
     * @var \DateTime
     * @validate DateTime, NotEmpty
     */
    protected $finishTime = null;

Render method :

<f:format.date format="%H:%M">{mymodel.finishTime}</f:format.date>

Can someone confirm this bug?

Thank you,
Jérémie

Actions #1

Updated by Mona Muzaffar about 7 years ago

  • Related to Epic #80852: Datetime handling in backend added
Actions #2

Updated by Markus Klein almost 7 years ago

  • Target version deleted (next-patchlevel)
  • Parent task set to #77562
Actions #3

Updated by Markus Klein almost 7 years ago

  • Status changed from New to Rejected

This is actually no real timestamp which is stored in DB, but only the seconds.
The subtle difference is that timestamps are UTC by definition, hence the format.date viewhelper will adjust the value to the current timezone.

So the behaviour is in the sense correct.

It is impossible to change the database value in a released version.

The only solution I can propose is to use a dedicated VH, which uses the \TYPO3\CMS\Backend\Utility\BackendUtility::time function to render the time.

Actions #4

Updated by Riccardo De Contardi almost 7 years ago

  • Related to deleted (Epic #80852: Datetime handling in backend)
Actions #5

Updated by Markus Klein almost 7 years ago

  • Parent task deleted (#77562)
Actions

Also available in: Atom PDF