Getting today’s date in YYYY-MM-DD in Python? – Max的程式...
datetime.datetime.today().strftime('%Y-%m-%d') 輸出的結果: 2017-09-15 Thedatetimemodule is your friend: importdatetime now=datetime.datetime.now()printnow.year,now.month,now.day,now.hour,now.minute,now.second