Date/Time: Reduce explicit local current_time( 'timestamp' ) usage in favor of native PHP functions.

Timestamps don't carry any timezone information, using the intended format directly simplifies the logic and makes the code less confusing.

Props Rarst, jdgrimes.
See #40657.

git-svn-id: https://develop.svn.wordpress.org/trunk@44809 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-03-07 09:11:37 +00:00
parent 79a3abcb2a
commit 4b10390b7d
7 changed files with 31 additions and 32 deletions

View File

@@ -1392,7 +1392,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
return '';
}
$time_diff = current_time( 'timestamp', true ) - $timestamp;
$time_diff = time() - $timestamp;
if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
/* translators: human readable timestamp */