From 4d807c33f9cea73ac8702990db68528bf800903f Mon Sep 17 00:00:00 2001 From: Nischay mrzn <129774293+Nischaymrzn@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:09:58 +0545 Subject: [PATCH] Create days_until.py --- Python/days_until.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Python/days_until.py diff --git a/Python/days_until.py b/Python/days_until.py new file mode 100644 index 0000000..804918e --- /dev/null +++ b/Python/days_until.py @@ -0,0 +1,4 @@ +from datetime import datetime +def days_until(date_str): + future_date = datetime.strptime(date_str, '%Y-%m-%d') + return (future_date - datetime.now()).days