📜  比较时间python代码示例

📅  最后修改于: 2022-03-11 14:46:52.594000             🧑  作者: Mango

代码示例1
#Check if now is before or after 8am:
now = datetime.datetime.now()
today8am = now.replace(hour=8, minute=0, second=0, microsecond=0)
#Perform the checks:
if (now < today8am):
  ...
if (now == today8am):
  ...