Skip to content

Commit

Permalink
Merge pull request #600 from sdy623/main
Browse files Browse the repository at this point in the history
bugfix: 修正了签到时日期时间的显示不补齐零的bug (符合日期时间表示法 ISO 8601)
  • Loading branch information
HibiKier authored May 24, 2022
2 parents 41836bd + c917585 commit 3bcef18
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugins/sign_in/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import asyncio
import random
import nonebot
import time
import locale
import os


Expand Down Expand Up @@ -260,15 +262,12 @@ def _generate_card(
today_data.text((0, 25), f"金币 + {gold}")
_type = "sign"
current_date = datetime.now()
week = current_date.isoweekday()
current_datetime_str = current_date.strftime("%Y-%m-%d %a %H:%M:%S")
data = current_date.date()
hour = current_date.hour
minute = current_date.minute
second = current_date.second
data_img = BuildImage(
0,
0,
plain_text=f"时间:{data} {weekdays[week]} {hour}:{minute}:{second}",
plain_text=f"时间:{current_datetime_str}",
color=(255, 255, 255, 0),
font_size=20,
)
Expand Down

0 comments on commit 3bcef18

Please sign in to comment.