From 6e5e5949c975c16f5e797c42e02868002bcc9b11 Mon Sep 17 00:00:00 2001 From: Al Azif <33132478+Al-Azif@users.noreply.github.com> Date: Sun, 7 Jan 2024 16:28:08 -0800 Subject: [PATCH] datetime.datetime.utcnow() is deprecated --- start.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start.py b/start.py index 4b77da2..d6f4455 100755 --- a/start.py +++ b/start.py @@ -67,7 +67,7 @@ SETTINGS = None MENU_OPEN = False DEBUG_VAR = {} -SCRIPT_START = (datetime.datetime.utcnow()).strftime('%a, %d %b %Y %H:%M:%S GMT') +SCRIPT_START = (datetime.datetime.now(datetime.UTC)).strftime('%a, %d %b %Y %H:%M:%S GMT') class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): @@ -522,7 +522,7 @@ def theme_loader(self): try: cookies = SimpleCookie(self.headers.get('Cookie')) - default_cookie = f"theme={SETTINGS['Theme']}; expires={(datetime.datetime.utcnow() + datetime.timedelta(days=36500)).strftime('%a, %d %b %Y %H:%M:%S GMT')}; domain={self.headers.get('Host')}; path={quote(self.path)};" + default_cookie = f"theme={SETTINGS['Theme']}; expires={(datetime.datetime.now(datetime.UTC) + datetime.timedelta(days=36500)).strftime('%a, %d %b %Y %H:%M:%S GMT')}; domain={self.headers.get('Host')}; path={quote(self.path)};" theme_error_html = b'