Issue Overview
Currently, get_last_updated_time() doesn’t contain a timezone. It’s always in format YYYY-mm-dd H:i:s. However, if you try to compare it with the current installed translations (e. g. as you do in (traduttore-registry)[https://github.com/wearerequired/traduttore-registry/blob/master/inc/namespace.php#L68]) this test could result in an unexpected result.
I updated a translation in 2018-12-03 11:29:25 local time, which is GMT+1. After updating the translations in my WordPress, their PO-Revision-Date ffrom wp_get_installed_translations() is correctly set to 2018-12-03 10:29:25+0000. However, the translations API does print the following updated date: 2018-12-03 10:29:25. The result was that the update notification for outstanding translations never gets removed.
I double-checked the compare by using the following code:
<?php
$with_timezone = new Datetime( '2018-12-03 10:29:25+0000' );
$without_timezone = new Datetime( '2018-12-03 10:29:25' );
switch ( true ) {
case $with_timezone > $without_timezone:
echo 'With > Without';
break;
case $with_timezone === $without_timezone:
echo 'With = Without';
break;
case $with_timezone < $without_timezone:
echo 'With < Without';
break;
}
Issue Overview Currently,
get_last_updated_time()
doesn’t contain a timezone. It’s always in formatYYYY-mm-dd H:i:s
. However, if you try to compare it with the current installed translations (e. g. as you do in (traduttore-registry)[https://github.com/wearerequired/traduttore-registry/blob/master/inc/namespace.php#L68]) this test could result in an unexpected result.I updated a translation in
2018-12-03 11:29:25
local time, which is GMT+1. After updating the translations in my WordPress, theirPO-Revision-Date
ffromwp_get_installed_translations()
is correctly set to2018-12-03 10:29:25+0000
. However, the translations API does print the followingupdated
date:2018-12-03 10:29:25
. The result was that the update notification for outstanding translations never gets removed.I double-checked the compare by using the following code:
Result:
Versions