1. 程式人生 > >python處理時間格式轉換,將xxxx年xx月xx日轉化為xxxx-xx-xx格式

python處理時間格式轉換,將xxxx年xx月xx日轉化為xxxx-xx-xx格式



publish_Time = "2018年10月10日"
array = time.strptime(publish_Time, u"%Y年%m月%d日")
try:
    publishTime = time.strftime("%Y-%m-%d", array)
except Exception, e:
    print e
print publishTime



作者:果凍先生的專欄
來源:CSDN
原文:https://blog.csdn.net/homewm/article/details/82996411