Skip to content

Instantly share code, notes, and snippets.

@K41R1
Created May 14, 2020 06:08
Show Gist options
  • Save K41R1/4c4accdd51857cb4a3fc14249cfdfc06 to your computer and use it in GitHub Desktop.
Save K41R1/4c4accdd51857cb4a3fc14249cfdfc06 to your computer and use it in GitHub Desktop.
import datetime
def checkIfMidnight():
now = datetime.now()
seconds_since_midnight = (now - now.replace(hour=0, minute=0, second=0, microsecond=0)).total_seconds()
return seconds_since_midnight == 0
def main():
print("hello world")
if __name__ == '__main__':
while True:
if checkIfMidnight():
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment