📜  python3 yyyymmddhhmmss - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:59.173000             🧑  作者: Mango

代码示例1
import datetime
 
currentDT = datetime.datetime.now()
 
print (currentDT.strftime("%Y-%m-%d %H:%M:%S"))
print (currentDT.strftime("%Y/%m/%d"))
print (currentDT.strftime("%H:%M:%S"))
print (currentDT.strftime("%I:%M:%S %p"))
print (currentDT.strftime("%a, %b %d, %Y"))