From 613b44e7e455dc87dd3c3397717d6af719cfbac4 Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Tue, 26 Mar 2024 23:53:36 +0100 Subject: [PATCH] calc days ago --- script.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script.py b/script.py index bb069a4..e5ada40 100644 --- a/script.py +++ b/script.py @@ -15,10 +15,15 @@ path = "/home/xpub/www/html/tl-dr/log-books" if not os.path.exists(path): os.makedirs(path) +if(time_ago_arg): + now = datetime.today() - timedelta(days=time_ago_arg) +else: + now = datetime.today() -now = datetime.today() book_name = "TL;DR_" + now.strftime("%B %dth %Y") +print(f"making a book called {book_name}") + def get_journalctl_on(): if time_ago_arg: return ["-S", f"{time_ago_arg + 1} days ago", "-U", f"{time_ago_arg} days ago"]