直接上代码 #!/usr/bin/python # -*- coding: UTF-8 -*- import datetime strTime=“2019-07-25 23:28:30” timeOrg = datetime.datetime.strptime(strTime, "%Y-%m-%d %H:%M:%S") deltaH = datetime.timedelta(seconds=30) timeRec = timeOrg + deltaH strTime = timeRec.strftime("%Y-%m-%d %H:%M:%S")
print(strTime)
#2019-07-25 23:29:00