User tests: Successful: Unsuccessful:
Pull Request for Issue #14587
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.
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());
var dump should show:
'UTC'
'UTC'
// correct
'UTC'
'Europe/Berlin'
// incorect
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
?
?
|
Thanks!
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.