我正在使用以下代码以特定格式使用日期并遇到以下错误..如何以 m/d/y 格式输入日期?
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'