|
@@ -175,7 +175,7 @@ def message_text(event):
|
|
|
|
|
|
if event.message.text=='熱門關鍵字':
|
|
|
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_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'
|