close

不知道為什麼中文這麼難找資源OAo

>>>import datetime

>>>import time

>>>endDate='2017/12/6'

>>> time_format=datetime.datetime.strptime(endDate,'%Y/%m/%d').strftime("%B %#d, %Y")

>>> time_format

'December 6, 2017'

參考文章https://stackoverflow.com/questions/904928/python-strftime-date-without-leading-0

全站熱搜
創作者介紹
創作者 程式小試身手 的頭像
程式小試身手

程式小試身手

程式小試身手 發表在 痞客邦 留言(0) 人氣()