将字符串中的时间转换为dateTime.datetime
continue
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我进入错误的格式。应该是
注意:我们必须根据给出的数据的格式输入格式!
I was entering the wrong format. It should have been
Note: We have to enter the format according to the format of the data given!