ValueError: time data '24:00' does not match format '%H:%M'

早过忘川 提交于 2019-12-06 11:21:34

You have to give 00:00 for 24:00. Last count in 24 hour format is 23:59 after that next value will be 00:00.

Like if you have 23:59, and add one more minutes in that

>>> a = datetime(1900, 1, 1, 23, 59)
>>> from datetime import timedelta
>>> a + timedelta(minutes=1)
datetime.datetime(1900, 1, 2, 0, 0)

You will get next date with 00:00

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!