Project

General

Profile

Actions

Bug #59613

closed

DateTime values in BE are shown in UTC

Added by Frans Saris over 10 years ago. Updated over 9 years ago.

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

0%

Estimated time:
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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Frans Saris over 10 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.

Actions #2

Updated by Anonymous over 9 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.

Actions

Also available in: Atom PDF