ming 3 lat temu
rodzic
commit
7027dab1c5
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      newbot.py

+ 2 - 2
newbot.py

@@ -176,8 +176,8 @@ def message_text(event):
     if event.message.text=='熱門關鍵字':
         db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/yodb?charset=utf8mb4')
         now = datetime.datetime.now()
-        now_start = now.strftime("%d-%m-%Y 00:00:00")
-        now_end = now.strftime("%d-%m-%Y 23:59:59")
+        now_start = now.strftime("%Y-%m-%d 00:00:00")
+        now_end = now.strftime("%Y-%m-%d 23:59:59")
         sqls = 'SELECT * FROM trending_searches WHERE "'+now_end+'">= ts_date and "'+now_start+'"<=ts_date ORDER BY ts_date DESC'
         ls = []
         for row in db.query(sqls):