
self.train_date = datetime.datetime.strptime(train_date,'%y-%m-%d').date()
when I run above code, I get below error

I don't get it..because I checked the date format.
Use Y for match YYYY format, because y is for YY format of year:
self.train_date = datetime.datetime.strptime(train_date,'%Y-%m-%d').date()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With