From 663fb8797612b863b0f0b94496039ec2ac18701c Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sat, 16 Sep 2023 09:05:42 +0900 Subject: [PATCH] Config states time ISO in system time zone --- modules/config_states.py | 3 +-- modules/ui_extensions.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/config_states.py b/modules/config_states.py index b766aef11d8..651793c7f6f 100644 --- a/modules/config_states.py +++ b/modules/config_states.py @@ -4,7 +4,6 @@ import os import json -import time import tqdm from datetime import datetime @@ -38,7 +37,7 @@ def list_config_states(): config_states = sorted(config_states, key=lambda cs: cs["created_at"], reverse=True) for cs in config_states: - timestamp = time.asctime(time.gmtime(cs["created_at"])) + timestamp = datetime.fromtimestamp(cs["created_at"]).strftime('%Y-%m-%d %H:%M:%S') name = cs.get("name", "Config") full_name = f"{name}: {timestamp}" all_config_states[full_name] = cs diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index 2e8c1d6d21d..c0a73b57380 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -197,7 +197,7 @@ def update_config_states_table(state_name): config_state = config_states.all_config_states[state_name] config_name = config_state.get("name", "Config") - created_date = time.asctime(time.gmtime(config_state["created_at"])) + created_date = datetime.fromtimestamp(config_state["created_at"]).strftime('%Y-%m-%d %H:%M:%S') filepath = config_state.get("filepath", "") try: