0665デフォルトの名無しさん
2018/10/15(月) 15:44:47.11ID:sW3L48egday = datetime.strptime(date,'%Y-%m-%d')
'''ここは、 = date.strptime(%Y-%m-%d') でできないのは何故??'''
before_5 = day - timedelta(days=5)
print_day = datetime.strftime(before_5,'%Y-%m-%d')
'''= before_5.strftime('%Y-%m-%d')でもできる。'''
print(print_day)
strptimeとstrftime. の入力の仕方が違うのはデフォルトですか?理由などありましたらおしえてください。