Answers for "compare times python"

0

compare times python

#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):
  ...
Posted by: Guest on October-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language