Explorar o código

return list only

ming %!s(int64=4) %!d(string=hai) anos
pai
achega
1b4a4c3aaf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      newbot.py

+ 1 - 1
newbot.py

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