From 78a18e3ca374c21759f335fc86908052007a8055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sat, 7 Mar 2026 19:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E3=80=81?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_will_task/models/yuthon_will_task.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 0acd091f4..bf101bb93 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -38,14 +38,14 @@ class YuthonWillTask(models.Model): ('22', '22:00'), ('22.25', '22:15'), ('22.5', '22:30'), ('22.75', '22:45'), ('23', '23:00'), ('23.25', '23:15'), ('23.5', '23:30'), ('23.75', '23:45')] def _default_request_hour_from(self): - """开始时间默认当前小时""" - now = datetime.now() + """开始时间默认当前小时(处理UTC+8时区)""" + now = fields.datetime.now() + timedelta(hours=8) hour = now.hour return str(hour) def _default_request_hour_to(self): - """结束时间默认当前小时+1(23+1=0)""" - now = datetime.now() + """结束时间默认当前小时+1(23+1=0,处理UTC+8时区)""" + now = fields.datetime.now() + timedelta(hours=8) hour = (now.hour + 1) % 24 return str(hour)