From 725204704ff6815944128e4dd66dd48c62e67688 Mon Sep 17 00:00:00 2001 From: chata <1399055+chata@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:12:31 +0900 Subject: [PATCH] Fix S3 backup list showing times shifted by the site's UTC offset BackWPup_Destination_S3::file_get_list() converts the S3 object's LastModified (UTC) to a Unix timestamp and then adds the site's gmt_offset to it. Unix timestamps are timezone-independent, so this shifts the epoch value into the future for sites east of UTC. Both the new backups history table (components/table-row-backups.php) and the legacy backups page (inc/class-page-backups.php) format this value with wp_date(), which already converts to the site timezone. The pre-shifted timestamp therefore gets the offset applied twice: on a UTC+9 site every S3/R2 backup is displayed 9 hours in the future (e.g. a backup taken at 13:40 JST shows as 10:40 PM), while backups stored in the local folder destination display correctly. Dropping the offset keeps retention pruning intact ( keys shift uniformly, so their order is unchanged) and makes both tables show the true backup time. --- inc/class-destination-s3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-destination-s3.php b/inc/class-destination-s3.php index 6a6ab29d..5faaf2fa 100755 --- a/inc/class-destination-s3.php +++ b/inc/class-destination-s3.php @@ -366,7 +366,7 @@ public function file_update_list($job, bool $delete = false): void if (is_object($objects)) { foreach ($objects as $object) { $file = basename((string) $object['Key']); - $changetime = strtotime((string) $object['LastModified']) + (get_option('gmt_offset') * 3600); + $changetime = strtotime((string) $object['LastModified']); if ($this->is_backup_archive($file) && $this->is_backup_owned_by_job($file, $jobid)) { $backupfilelist[$changetime] = $file;