From 6016f799bdd0cd1195b3b1a09b3d2e663136557b Mon Sep 17 00:00:00 2001 From: hyejiyu Date: Tue, 24 Sep 2024 03:42:50 +0900 Subject: [PATCH] modified homeplus consumers datetime changing from UST to KST --- messagequeue/consumer/homeplus_consumer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/messagequeue/consumer/homeplus_consumer.py b/messagequeue/consumer/homeplus_consumer.py index 8febdb4..b8d9e53 100644 --- a/messagequeue/consumer/homeplus_consumer.py +++ b/messagequeue/consumer/homeplus_consumer.py @@ -40,6 +40,8 @@ def reset_timer(): start = time.time() current_date = datetime.datetime.now().strftime('%Y-%m-%d') +KST = timezone(timedelta(hours=9)) +now_hour = datetime.datetime.now(KST)[11:13] timer = None # 콜백 함수 정의 (메시지 수신 시 호출됨) @@ -48,7 +50,6 @@ def callback(ch, method, properties, body): global start cnt += 1 reset_timer() - now_hour = datetime.datetime.now().hour # formatted_date = now.strftime("%Y-%m-%d %H:%M:%S") message_str = body.decode('utf-8') message_json = json.loads(message_str)