? Pending

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
1 Sep 2017

Pull Request for Issue #17770 .

Summary of Changes

@infograf768 i think 3.x has some extra code for the user_utc compared to 2.x.
I think it's these lines:

$this->value = strftime($this->format, strtotime($this->value));
date_default_timezone_set($tz);

We always read the input as UTC and convert it to server or user but the user submitted the date with their local timezone (most of the times the browser will have the timezone to the area that the user is living). There is the inconsistency...

this should run only when the code is coming from the db, for the data that comes from a form input we need to convert it to UTC. That will fix the problem

Testing Instructions

check #17770

Expected result

Dates are set correctly

Actual result

Dates are set correctly

Documentation Changes Required

No

avatar joomla-cms-bot joomla-cms-bot - change - 1 Sep 2017
Category Libraries
avatar dgt41 dgt41 - open - 1 Sep 2017
avatar dgt41 dgt41 - change - 1 Sep 2017
Status New Pending
avatar infograf768 infograf768 - test_item - 1 Sep 2017 - Tested successfully
avatar infograf768
infograf768 - comment - 1 Sep 2017

I have tested this item successfully on 3f3d1a5

Great!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17823.

avatar infograf768
infograf768 - comment - 1 Sep 2017

The screenshot in #17770 explains how to test.
Basically, clear the start publishing date for an item, then close the calendar popup, then open the popup again and click on Today.
then look its status in the manager.

This is an old bug that been there for ever.
It is very rare to change the start publishing date to Today as it is set such by default when creating a new item. But it is not rare to set a Start Publishing date in the future, thus not remarking the error.

Someone may not remark the bug when the local computer time zone is set to UTC or UTC-#

Anyone will experience the bug when the local computer is set to UTC+#

avatar alikon alikon - test_item - 4 Sep 2017 - Tested successfully
avatar alikon
alikon - comment - 4 Sep 2017

I have tested this item successfully on 3f3d1a5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17823.

avatar infograf768 infograf768 - change - 4 Sep 2017
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 4 Sep 2017

rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17823.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Sep 2017

RTC after two successful tests.

avatar Bakual
Bakual - comment - 16 Sep 2017

Actually, I think this issue is not a code issue. It happens because of a wrong user setting. For the calendar (and other date processing) and its UTC conversion to work properly, the user timezone obviously needs to be set to the timezone of the user. Otherwise the server will not know how to convert the datetime properly and it will off by some hours.

In my testing, I only could reproduce the issue when I had set my user timezone to a different than my real timezone "Zurich". Eg setting it to "New York" will produce the effect in my case because I input my local time but the server will interpret it as the time in New York and thus it will be 6 hours "later".

avatar mbabker mbabker - change - 25 Sep 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-09-25 11:43:15
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 25 Sep 2017
avatar mbabker mbabker - merge - 25 Sep 2017

Add a Comment

Login with GitHub to post a comment