From 792cb23b41b24310eddd716a7fd4d855dd62c735 Mon Sep 17 00:00:00 2001 From: Syed Mustafa Hassan <98483655+Mustafa-Hassan2001@users.noreply.github.com> Date: Tue, 27 Feb 2024 00:54:14 +0500 Subject: [PATCH] Create Counter_App.py --- Counter_App.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Counter_App.py diff --git a/Counter_App.py b/Counter_App.py new file mode 100644 index 00000000..44e3437d --- /dev/null +++ b/Counter_App.py @@ -0,0 +1,14 @@ +import datetime +user_input = input("Enter your goal with a deadline separatedby colon\n") +input_list = user_input.split(":") + +# goal = input_list[0] +deadline = input_list[0] + + +deadline_date = datetime.datetime.strptime(deadline, "%d.%m.%Y") +today_date = datetime.datetime.today() +time_till = deadline_date - today_date + +hours_till = int(time_till.total_seconds()/ 60/ 60) +print(f"Dear User! Time remanning for your goal : {goal} is {hours_till} hours")