Fix time format: clean spaces before truncating to avoid cutting seconds
Previous order: [:19] then replace(": ", ":") would truncate "06: 59: 28"
to "06: 59: " before cleaning, losing the seconds entirely.
Correct order: clean spaces first, then [:19].
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4e85dff07d
commit
1f49f5bff5
@@ -22,9 +22,9 @@ def _fmt_datetime(val) -> str:
|
||||
return ""
|
||||
if hasattr(val, "strftime"):
|
||||
return val.strftime("%d/%m/%Y %H:%M:%S")
|
||||
# Eliminar espacios dentro de la parte de hora ("06: 08: 29" → "06:08:29")
|
||||
s = str(val)[:19].replace("T", " ")
|
||||
s = s.replace(": ", ":").replace(" :", ":")
|
||||
# Eliminar espacios dentro de la hora ANTES de truncar ("06: 59: 28" → "06:59:28")
|
||||
s = str(val).replace(": ", ":").replace(" :", ":")
|
||||
s = s[:19].replace("T", " ")
|
||||
parts = s.split(" ")
|
||||
if len(parts) == 2:
|
||||
dp = parts[0].split("-")
|
||||
|
||||
Reference in New Issue
Block a user