Skip to content

Instantly share code, notes, and snippets.

@feiandxs
Created June 10, 2022 06:25
Show Gist options
  • Save feiandxs/61a6a04d64309c452a7457938a899db9 to your computer and use it in GitHub Desktop.
Save feiandxs/61a6a04d64309c452a7457938a899db9 to your computer and use it in GitHub Desktop.
+8小时
'''
Date: 2022-06-01 15:25:41
LastEditors: ibegyourpardon
LastEditTime: 2022-06-01 15:29:35
FilePath: /undefined/Users/feiandxs/Downloads/8.py
'''
import datetime
eta_temp = '2022-06-01 13:15:02'
fd = datetime.datetime.strptime(eta_temp, "%Y-%m-%d %H:%M:%S")
# 加8后的时间
eta = (fd + datetime.timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
print(eta)
def plus_8_hour(fd):
eta = (fd + datetime.timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
return eta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment