User tests: Successful: Unsuccessful:
Fix for JDate Constructor, integrates the test case from #15642 but with true as 2nd parameter for the format method (default is false and means that we get the time in GMT)
Test should be processed with two different PHP Versions one lower 7.1.0 and one 7.1.0 or greater. The results should be the "same" for all versions after the patch is applied.
echo 'Timezone US/Central: ';
$jdateUS = new JDate('now', new DateTimeZone('US/Central'));
$phpdateUS = new DateTime('now', new DateTimeZone('US/Central'));
echo $jdateUS->format('D m/d/Y H:i', true) . ' | ' . $phpdateUS->format('D m/d/Y H:i');
echo '<br>';
echo 'Timezone UTC: ';
$jdateUTC = new JDate('now', new DateTimeZone('UTC'));
$phpdateUTC = new DateTime('now', new DateTimeZone('UTC'));
echo $jdateUTC->format('D m/d/Y H:i', true) . ' | ' . $phpdateUTC->format('D m/d/Y H:i');
echo '<br>';
echo 'Timezone not set: ';
$jdateNoTZ = new JDate('now');
$phpdateNoTZ = new DateTime('now');
echo $jdateNoTZ->format('D m/d/Y H:i', true) . ' | ' . $phpdateNoTZ->format('D m/d/Y H:i');
Access your site
Change the PHP version
Access your site again
Apply patch
Access your site
Change the PHP version
Access your site again
Test is successful when after appling the patch you get correct results, time in a row must be the same expect the last line.
Keep in mind your results are depending on your timezone and the time you are running the test. For me the 2 hour difference in the "Timezone not set" row is ok because I am on CEST what is GMT+2.
The Error is in the "Timezone US/Central" row for PHP Version lower 7.1.0, in my case 5.6.30.
Before Patch:
7.1.1 (local time 14:29)
Timezone US/Central: Sat 05/06/2017 07:29 | Sat 05/06/2017 07:29
Timezone UTC: Sat 05/06/2017 12:29 | Sat 05/06/2017 12:29
Timezone not set: Sat 05/06/2017 12:29 | Sat 05/06/2017 14:29
5.6.30 (local time 14:31)
Timezone US/Central: Sat 05/06/2017 12:31 | Sat 05/06/2017 07:31
Timezone UTC: Sat 05/06/2017 12:31 | Sat 05/06/2017 12:31
Timezone not set: Sat 05/06/2017 12:31 | Sat 05/06/2017 14:31
After Patch
7.1.1 (local time 14:35)
Timezone US/Central: Sat 05/06/2017 07:35 | Sat 05/06/2017 07:35
Timezone UTC: Sat 05/06/2017 12:35 | Sat 05/06/2017 12:35
Timezone not set: Sat 05/06/2017 12:35 | Sat 05/06/2017 14:35
5.6.30 (local time 14:34)
Timezone US/Central: Sat 05/06/2017 07:34 | Sat 05/06/2017 07:34
Timezone UTC: Sat 05/06/2017 12:34 | Sat 05/06/2017 12:34
Timezone not set: Sat 05/06/2017 12:34 | Sat 05/06/2017 14:34
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries Unit Tests |
Labels |
Added:
?
?
?
|
I have tested this item
Here are my test results:
Test with patch and PHP 7.1.3:
Timezone US/Central: Wed 05/10/2017 02:00 | Wed 05/10/2017 02:00
Timezone UTC: Wed 05/10/2017 07:00 | Wed 05/10/2017 07:00
Timezone not set: Wed 05/10/2017 07:00 | Wed 05/10/2017 07:00
Test with patch and PHP 5.6.20:
Timezone US/Central: Wed 05/10/2017 02:03 | Wed 05/10/2017 02:03
Timezone UTC: Wed 05/10/2017 07:03 | Wed 05/10/2017 07:03
Timezone not set: Wed 05/10/2017 07:03 | Wed 05/10/2017 07:03
Test without patch and PHP 7.1.3:
Timezone US/Central: Wed 05/10/2017 02:05 | Wed 05/10/2017 02:05
Timezone UTC: Wed 05/10/2017 07:05 | Wed 05/10/2017 07:05
Timezone not set: Wed 05/10/2017 07:05 | Wed 05/10/2017 07:05
Test without patch and PHP 5.6.20:
Timezone US/Central: Wed 05/10/2017 07:04 | Wed 05/10/2017 02:04
Timezone UTC: Wed 05/10/2017 07:04 | Wed 05/10/2017 07:04
Timezone not set: Wed 05/10/2017 07:04 | Wed 05/10/2017 07:04
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/15853">issues.joomla.org/tracker/joomla-cms/15853</a>.</sub>
I have tested this item
Note all versions of PHP with PHP-FPM = On and also tested with PHP-FPM = Off
Tests:
PHP 7.1.14 without patch
Timezone US/Central: Wed 05/10/2017 09:02 | Wed 05/10/2017 09:02
Timezone UTC: Wed 05/10/2017 14:02 | Wed 05/10/2017 14:02
Timezone not set: Wed 05/10/2017 14:02 | Wed 05/10/2017 09:02
PHP 7.1.14 with patch
Timezone US/Central: Wed 05/10/2017 09:07 | Wed 05/10/2017 09:07
Timezone UTC: Wed 05/10/2017 14:07 | Wed 05/10/2017 14:07
Timezone not set: Wed 05/10/2017 14:07 | Wed 05/10/2017 09:07
PHP 5.6.30 without patch
Timezone US/Central: Wed 05/10/2017 14:08 | Wed 05/10/2017 09:08
Timezone UTC: Wed 05/10/2017 14:08 | Wed 05/10/2017 14:08
Timezone not set: Wed 05/10/2017 14:08 | Wed 05/10/2017 09:08
PHP 5.6.30 with patch
Timezone US/Central: Wed 05/10/2017 09:09 | Wed 05/10/2017 09:09
Timezone UTC: Wed 05/10/2017 14:09 | Wed 05/10/2017 14:09
Timezone not set: Wed 05/10/2017 14:09 | Wed 05/10/2017 09:09
PHP 7.0 without patch
Timezone US/Central: Wed 05/10/2017 14:10 | Wed 05/10/2017 09:10
Timezone UTC: Wed 05/10/2017 14:10 | Wed 05/10/2017 14:10
Timezone not set: Wed 05/10/2017 14:10 | Wed 05/10/2017 09:10
PHP 7.0 with patch
Timezone US/Central: Wed 05/10/2017 09:11 | Wed 05/10/2017 09:11
Timezone UTC: Wed 05/10/2017 14:11 | Wed 05/10/2017 14:11
Timezone not set: Wed 05/10/2017 14:11 | Wed 05/10/2017 09:11
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-10 14:43:14 |
Closed_By | ⇒ | jeckodevelopment | |
Labels |
Added:
?
|
I did remove the version check, seems to me not really important if JDate has microseconds or not