From 2155ad70457bc04755ca6e5b5b09492395e015b3 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 16 Jul 2023 00:20:11 +0800 Subject: [PATCH] fix time zone in crash.py --- Difficult_Rocket/crash/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Difficult_Rocket/crash/__init__.py b/Difficult_Rocket/crash/__init__.py index 11746f0..3627b3d 100644 --- a/Difficult_Rocket/crash/__init__.py +++ b/Difficult_Rocket/crash/__init__.py @@ -77,7 +77,7 @@ def create_crash_report(info: Optional[str] = None) -> None: crash_info = crash_info_handler(info) if 'crash_report' not in os.listdir('./'): os.mkdir('./crash_report') - date_time = time.strftime('%Y-%m-%d %H-%M-%S', time.gmtime(time.time())) + date_time = time.strftime('%Y-%m-%d %H-%M-%S', time.localtime()) filename = f'crash-{date_time}.md' cache_stream = io.StringIO() try: @@ -92,7 +92,7 @@ def create_crash_report(info: Optional[str] = None) -> None: def write_cache(cache_stream, crash_info): # 开头信息 - cache_stream.write(Head_message.format(now_time=time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(time.time())))) + cache_stream.write(Head_message.format(now_time=time.strftime('%Y/%m/%d %H:%M:%S', time.localtime()))) # 崩溃信息 cache_stream.write(crash_info)