From f8d09c5cfd6d1d9595b64547dc9d29c63e40c5f2 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Thu, 5 Dec 2024 13:49:22 -0500 Subject: Moved .local/bin to scripts --- scripts/days2finals.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/days2finals.py (limited to 'scripts/days2finals.py') diff --git a/scripts/days2finals.py b/scripts/days2finals.py new file mode 100755 index 0000000..2111af6 --- /dev/null +++ b/scripts/days2finals.py @@ -0,0 +1,23 @@ +import datetime +now = datetime.datetime.now() + +finalsDate = datetime.datetime(2023, 5, 1, 0, 0, 0, 0) +breakDate = datetime.datetime(2023, 3, 3, 15, 0, 0, 0) +def getDays(date, name): + daysLeft = date - now + + weeks = daysLeft.days // 7 + days = daysLeft.days % 7 + minutes = daysLeft.seconds // 60 + hours = minutes // 60 + minutes %= 60 + + if (weeks < 0): + return f"{name.upper()} WEEK" + return f"{weeks} weeks {days} days and {hours} hours until {name} week" + +output = f"{getDays(finalsDate, 'finals')}" +#output += f"{getDays(breakDate, 'break')}" + + +print(output) -- cgit v1.2.3