diff options
Diffstat (limited to 'scripts/days2finals.py')
| -rwxr-xr-x | scripts/days2finals.py | 23 |
1 files changed, 23 insertions, 0 deletions
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)
|
