Switch to UTC timestamps, output in local time

This commit is contained in:
2026-01-22 23:56:07 +01:00
parent 9c7f4dfd1a
commit 9f75e5e66b
5 changed files with 23 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ def cmd_user_list(args, app):
return 0
print(f"\n{'Username':<20} {'Email':<30} {'Hostnames':<10} {'Created'}")
print("-" * 82)
print("-" * 86)
for user in users:
hostname_count = Hostname.select().where(
Hostname.user == user
@@ -150,15 +150,15 @@ def cmd_hostname_list(args, app):
print(
f"{'Hostname':<35} {'User':<15} {'Zone':<20} "
f"{'DNS-TTL':<8} {'Exp-TTL':<8} {'Last-Update IPv4':<21} {'Last-Update IPv6'}"
f"{'DNS-TTL':<8} {'Exp-TTL':<8} {'Last-Update IPv4':<25} {'Last-Update IPv6'}"
)
print("-" * 132)
print("-" * 140)
for h in hostnames:
last_ipv4_update = datetime_str(h.last_ipv4_update) if h.last_ipv4_update else "Never"
last_ipv6_update = datetime_str(h.last_ipv6_update) if h.last_ipv6_update else "Never"
last_ipv4_update = datetime_str(h.last_ipv4_update)
last_ipv6_update = datetime_str(h.last_ipv6_update)
print(
f"{h.hostname:<35} {h.user.username:<15} {h.zone:<20} "
f"{h.dns_ttl:<8} {h.expiry_ttl:<8} {last_ipv4_update:<21} {last_ipv6_update}"
f"{h.dns_ttl:<8} {h.expiry_ttl:<8} {last_ipv4_update:<25} {last_ipv6_update}"
)
return 0
@@ -252,7 +252,7 @@ def cmd_hostname_delete(args, app):
logging.warning(f"DNS delete failed: type=AAAA error={e}")
hostname.delete_instance()
print(f"Hostname '{hostname_str}' deleted.")
print(f"Hostname '{hostname_str}' in zone '{zone}' deleted.")
return 0