from datetime import datetime
datetime.strptime(b,'%Y年%m月%d日')#將字符串轉化爲時間格式格式
import time
time.strptime(b,'%Y年%m月%d日')#將字符串轉化爲分段時間戳格式
now_date = datetime.now().strftime('%Y-%m-%d') # 當前時間格式轉化爲字符串
上述爲字符串與時間日期格式互轉的方法
from datetime import datetime
datetime.strptime(b,'%Y年%m月%d日')#將字符串轉化爲時間格式格式
import time
time.strptime(b,'%Y年%m月%d日')#將字符串轉化爲分段時間戳格式
now_date = datetime.now().strftime('%Y-%m-%d') # 當前時間格式轉化爲字符串
上述爲字符串與時間日期格式互轉的方法