-3
date_time_str = data['date']
date_time_obj = dt.datetime.strptime(date_time_str, "%Y-%m-%d %H:%M:%S")
print(date_time_obj)

I get this error:

ValueError: time data 'date' does not match format '%Y-%m-%d %H:%M:%S

But the string datetime is the same exact format as I formatted above:

"2020-08-30 20:29:42"
Ovicron
  • 91
  • 1
  • 4
  • 9

1 Answers1

1

I think the problem is not this dt.datetime.strptime(date_time_str, "%Y-%m-%d %H:%M:%S"). It looks like data['date'] is a time data.

bilginyuksel
  • 160
  • 2
  • 7