mirror of
https://github.com/netinvent/npbackup.git
synced 2024-09-20 14:56:14 +08:00
GUI: Fix parsing different timestamp formats on platforms
This commit is contained in:
parent
dddd6b990e
commit
66ab12dd89
|
@ -549,8 +549,11 @@ def _main_gui(viewer_mode: bool):
|
|||
if snapshots:
|
||||
snapshots.reverse() # Let's show newer snapshots first
|
||||
for snapshot in snapshots:
|
||||
# So we get different snapshot time formats depending on platforms:
|
||||
# windows 2024-09-06T13:58:10.7684887+02:00
|
||||
# Linux 2024-09-06T11:39:06.566382538Z
|
||||
if re.match(
|
||||
r"[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\..*[+-][0-2][0-9]:[0-9]{2}",
|
||||
r"[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\..*(Z|[+-][0-2][0-9]:[0-9]{2})?",
|
||||
snapshot["time"],
|
||||
):
|
||||
snapshot_date = dateutil.parser.parse(snapshot["time"]).strftime(
|
||||
|
|
Loading…
Reference in a new issue