* [PATCH proxmox-backup] fix #8109: catalog: dump: print file mtime in UTC
@ 2026-11-18 5:40 Kim Soo
2026-11-18 6:06 ` [PATCH proxmox-backup v2] " Kim Soo
0 siblings, 1 reply; 3+ messages in thread
From: Kim Soo @ 2026-11-18 5:40 UTC (permalink / raw)
To: pbs-devel; +Cc: Kim Soo
The catalog dump formatted the file mtime with strftime_local() but
appended a literal 'Z', so the printed time was off by the local UTC
offset while claiming to be UTC. Depending on the offset the date was
wrong as well.
Use epoch_to_rfc3339_utc() instead, which is also used for snapshot
names, so the output is actually UTC and consistent with them.
Signed-off-by: Kim Soo <popododo0720@naver.com>
---
Tested with a file with mtime 2026-01-01T00:00:00Z:
before:
TZ=Asia/Seoul -> 2026-01-01T09:00:00Z
TZ=UTC -> 2026-01-01T00:00:00Z
after:
TZ=Asia/Seoul -> 2026-01-01T00:00:00Z
TZ=UTC -> 2026-01-01T00:00:00Z
TZ=America/New_York -> 2026-01-01T00:00:00Z
pbs-datastore/src/catalog.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pbs-datastore/src/catalog.rs b/pbs-datastore/src/catalog.rs
index a2e79dea8..9f2fca881 100644
--- a/pbs-datastore/src/catalog.rs
+++ b/pbs-datastore/src/catalog.rs
@@ -745,7 +745,7 @@ impl<R: Read + Seek> CatalogReader<R> {
}
CatalogEntryType::File => {
let mut mtime_string = mtime.to_string();
- if let Ok(s) = proxmox_time::strftime_local("%FT%TZ", mtime) {
+ if let Ok(s) = proxmox_time::epoch_to_rfc3339_utc(mtime) {
mtime_string = s;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH proxmox-backup v2] fix #8109: catalog: dump: print file mtime in UTC
2026-11-18 5:40 [PATCH proxmox-backup] fix #8109: catalog: dump: print file mtime in UTC Kim Soo
@ 2026-11-18 6:06 ` Kim Soo
2026-11-25 15:40 ` Christian Ebner
0 siblings, 1 reply; 3+ messages in thread
From: Kim Soo @ 2026-11-18 6:06 UTC (permalink / raw)
To: pbs-devel; +Cc: Kim Soo
The catalog dump formatted the file mtime with strftime_local() but
appended a literal 'Z', so the printed time was off by the local UTC
offset while claiming to be UTC. Depending on the offset the date was
wrong as well.
This affects both code paths of the dump: the regular catalog, and the
fallback for snapshots created with change detection mode 'metadata',
which have no catalog and are dumped from the metadata archives.
Use epoch_to_rfc3339_utc() in both places instead, which is also used
for snapshot names, so the output is actually UTC and consistent with
them.
Signed-off-by: Kim Soo <popododo0720@naver.com>
---
Changes v1 -> v2:
* also fix the fallback path for snapshots without a catalog
(change detection mode 'metadata') in pbs-client
Tested with a file with mtime 2026-01-01T00:00:00Z, dumping a snapshot
with a catalog (default mode) and one created with
--change-detection-mode metadata:
before after
default, Seoul 2026-01-01T09:00:00Z 2026-01-01T00:00:00Z
default, UTC 2026-01-01T00:00:00Z 2026-01-01T00:00:00Z
default, New_York 2025-12-31T19:00:00Z 2026-01-01T00:00:00Z
metadata, Seoul 2026-01-01T09:00:00Z 2026-01-01T00:00:00Z
metadata, UTC 2026-01-01T00:00:00Z 2026-01-01T00:00:00Z
metadata, New_York 2025-12-31T19:00:00Z 2026-01-01T00:00:00Z
pbs-client/src/pxar/tools.rs | 2 +-
pbs-datastore/src/catalog.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pbs-client/src/pxar/tools.rs b/pbs-client/src/pxar/tools.rs
index 0c8c2927e..2c62f6230 100644
--- a/pbs-client/src/pxar/tools.rs
+++ b/pbs-client/src/pxar/tools.rs
@@ -432,7 +432,7 @@ pub async fn pxar_metadata_catalog_dump_dir<T: Clone + Send + Sync + ReadAt>(
match attr {
DirEntryAttribute::File { size, mtime } => {
let mut mtime_string = mtime.to_string();
- if let Ok(s) = proxmox_time::strftime_local("%FT%TZ", mtime) {
+ if let Ok(s) = proxmox_time::epoch_to_rfc3339_utc(mtime) {
mtime_string = s;
}
info!("{etype} {entry_path:?} {size} {mtime_string}");
diff --git a/pbs-datastore/src/catalog.rs b/pbs-datastore/src/catalog.rs
index a2e79dea8..9f2fca881 100644
--- a/pbs-datastore/src/catalog.rs
+++ b/pbs-datastore/src/catalog.rs
@@ -745,7 +745,7 @@ impl<R: Read + Seek> CatalogReader<R> {
}
CatalogEntryType::File => {
let mut mtime_string = mtime.to_string();
- if let Ok(s) = proxmox_time::strftime_local("%FT%TZ", mtime) {
+ if let Ok(s) = proxmox_time::epoch_to_rfc3339_utc(mtime) {
mtime_string = s;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH proxmox-backup v2] fix #8109: catalog: dump: print file mtime in UTC
2026-11-18 6:06 ` [PATCH proxmox-backup v2] " Kim Soo
@ 2026-11-25 15:40 ` Christian Ebner
0 siblings, 0 replies; 3+ messages in thread
From: Christian Ebner @ 2026-11-25 15:40 UTC (permalink / raw)
To: Kim Soo, pbs-devel
On 11/20/26 2:58 PM, Kim Soo wrote:
> The catalog dump formatted the file mtime with strftime_local() but
> appended a literal 'Z', so the printed time was off by the local UTC
> offset while claiming to be UTC. Depending on the offset the date was
> wrong as well.
>
> This affects both code paths of the dump: the regular catalog, and the
> fallback for snapshots created with change detection mode 'metadata',
> which have no catalog and are dumped from the metadata archives.
>
> Use epoch_to_rfc3339_utc() in both places instead, which is also used
> for snapshot names, so the output is actually UTC and consistent with
> them.
>
> Signed-off-by: Kim Soo <popododo0720@naver.com>
> ---
Thanks for the patch, version 2 looks good to me.
Was pondering if we should align the behavior to the catalog shell's
stat command output or pxar list, which show it as e.g. 2026-11-24
10:27:10, but since the timestamp already presented itself as being UTC
it is better to keep this approach for the fix.
Tested-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-25 15:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 5:40 [PATCH proxmox-backup] fix #8109: catalog: dump: print file mtime in UTC Kim Soo
2026-11-18 6:06 ` [PATCH proxmox-backup v2] " Kim Soo
2026-11-25 15:40 ` Christian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox