Bug #59613

DateTime values in BE are shown in UTC

Added by Frans Saris over 5 years ago. Updated almost 5 years ago.

Status:
Rejected
Priority:
Won't have this time
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-06-16
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

DateTime values are not only saved in UTC but also shown in UTC in BE.

When you fill a time field with 00:01 in BE it is visible in list view as 00:01 but in FE as 01:01.

TCA

            'config' => array(
                'type' => 'input',
                'size' => 8,
                'max' => 10,
                'eval' => 'time',
            ),

ExtBase model


    /**
     * Start time
     *
     * @var \DateTime
     */
    protected $startTime;

LocalConfiguration timezone settings

 [SYS][phpTimeZone] = 'Europe/Amsterdam'

So it looks like that date/time values are always saved and displayed in BE as UTC and not converted to local timezone.


Related issues

Related to TYPO3 Core - Bug #51918: Native date and datetime values do not consider timezone Closed 2013-09-11

History

#1 Updated by Frans Saris over 5 years ago

  • Status changed from New to Rejected
  • Priority changed from Must have to Won't have this time

Okay just TCA eval time is affected when used in extbase as DateTime property.

Looks like a timestamp thingie. If I Create a new DateTime() object and then call ->setTimestamp(60); the timezone offset changes !?
I guess it has something to do with different timezone in 1970?

So conclusion: Do not use DateTime for time fields.

#2 Updated by Mathias Bruckmoser almost 5 years ago

Frans Saris wrote:

Okay just TCA eval time is affected when used in extbase as DateTime property.

Looks like a timestamp thingie. If I Create a new DateTime() object and then call ->setTimestamp(60); the timezone offset changes !?
I guess it has something to do with different timezone in 1970?

So conclusion: Do not use DateTime for time fields.

No solution for me. How to store a time value and a date value separately? I dont wana use old shool timestamps in modern applications.
My current workaround ist to use a unlovely own TCA-Hook for BE-Field with correct timezone.

Also available in: Atom PDF