6
我正在使用以下代碼以特定格式使用日期並運行到以下錯誤..如何將日期設置爲m/d/y格式?AttributeError:'str'對象沒有屬性'strftime'
from datetime import datetime, date
def main():
cr_date = '2013-10-31 18:23:29.000227'
crrdate = cr_date.strftime(cr_date,"%m/%d/%Y")
if __name__ == '__main__':
main()
錯誤: -
AttributeError: 'str' object has no attribute 'strftime'