? ? ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
30 May 2020

Pull Request for Issue #14587

Summary of Changes

As described in #14587 JDate incorrectly resets the TZ if the server default time zone not UTC.
In some reason JDate resets TZ to the server default instead of "previous state".
This patch fixing this strange behavior.

Testing Instructions

In the root index.php add

date_default_timezone_set('Europe/Berlin'); // emulate server time zone Europe/Berlin

in template index.php add:

date_default_timezone_set('UTC');
var_dump(date_default_timezone_get());
$someDate = JDate::getInstance('now -3 day');
var_dump(date_default_timezone_get());

Expected result

var dump should show:
'UTC'
'UTC' // correct

Actual result

'UTC'
'Europe/Berlin' // incorect

avatar Fedik Fedik - open - 30 May 2020
avatar Fedik Fedik - change - 30 May 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2020
Category Libraries
avatar richard67 richard67 - test_item - 30 May 2020 - Tested successfully
avatar richard67
richard67 - comment - 30 May 2020

I have tested this item successfully on 2d5ab45

1. Code review: Good.
2. Real test as described: Good.
3. As a guy who deals with time series and timezone conversions since some 20 years I can say this change is needed since long time.


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

avatar bonzani bonzani - test_item - 2 Jun 2020 - Tested successfully
avatar bonzani
bonzani - comment - 2 Jun 2020

I have tested this item successfully on 2d5ab45


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

avatar Quy Quy - change - 2 Jun 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 2 Jun 2020

RTC


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

avatar wilsonge wilsonge - close - 7 Jun 2020
avatar wilsonge wilsonge - merge - 7 Jun 2020
avatar wilsonge wilsonge - change - 7 Jun 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-06-07 13:15:40
Closed_By wilsonge
Labels Added: ? ? ?
avatar wilsonge
wilsonge - comment - 7 Jun 2020

Thanks!

Add a Comment

Login with GitHub to post a comment