Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from datetime import timedelta, timezone
- from datetime import datetime as dt
- from time import sleep
- end = dt(2018, 8, 30, 23, 30, 0)
- local = str(end.replace(tzinfo=timezone.utc).astimezone()).split(' ')[0][:-2]
- while True:
- utc_time_on_your_pc = dt.utcnow().replace(microsecond=0)
- print(f'\n\n{"*" * 36}\n')
- print(f" Course ends on: {local[:-1]}")
- if end - utc_time_on_your_pc > timedelta(0):
- print(f" and that's in: {end - utc_time_on_your_pc}")
- print(f'\n{"*" * 36}')
- sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement