0

I have a time in the form time = '2022-06-29 07:55:28' that has the type str I want to store it in the firebase in the firebase's format. For that I have tried datetime.strptime(time, '%Y %m %d %I:%M:%S%p'). But I am getting the following error:

ValueError: time data '2022-06-29 07:55:28' does not match format '%Y %m %d %I:%M:%S%p'

Kindly help me out in this. Should I go for momentjs or something similar?

Adeena Lathiya
  • 165
  • 1
  • 11

1 Answers1

0

I was entering the wrong format. It should have been

time = datetime.strptime(time, '%Y-%m-%d %H:%M:%S')

Note: We have to enter the format according to the format of the data given!

Adeena Lathiya
  • 165
  • 1
  • 11