Skip to content
Snippets Groups Projects

Timer

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Rasmus Ringdahl
    Edited
    timer.py 288 B
    from datetime import datetime
    import time
    while True:
         with open('time.txt','a') as file:
            current_time = '{date}'.format(date=datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
            file.write('{date}\n'.format(date=current_time))
            print(current_time)
         time.sleep(60)
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment