From b04e4b078a9c082e218f9e8cc74c1e854d15db54 Mon Sep 17 00:00:00 2001 From: Andrew Conlin Date: Mon, 14 Apr 2025 04:48:14 +0900 Subject: [PATCH] [2025-04-13] Send full time string in Javascript --- build/templates/init.html | 10 +++++----- build/year-progress.py | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build/templates/init.html b/build/templates/init.html index 3944df9..bc177e1 100644 --- a/build/templates/init.html +++ b/build/templates/init.html @@ -1,18 +1,18 @@
- +
diff --git a/build/year-progress.py b/build/year-progress.py index 06648fb..809dcec 100644 --- a/build/year-progress.py +++ b/build/year-progress.py @@ -175,7 +175,8 @@ def getHomoSapiens(yearPercent): return f"Homo Sapiens have been around for ~{-math.floor(yearsUntilHumans)} years" def getTemplate(timestamp): - now = datetime.datetime.fromtimestamp(timestamp) + # Tue, 22 Nov 2011 06:00:00 GMT + now = datetime.datetime.strptime(timestamp,"%a, %d %b %Y %H:%M:%S %Z") nowTime = now.strftime("%-I:%M%p") nowDate = now.strftime("%A") + " " + now.strftime("%-d") + " " + now.strftime("%B") @@ -215,7 +216,7 @@ def index(timestamp): @app.route("/", methods=["GET","POST"]) def init(): if request.method == "POST": - timestamp = int(request.values.get('timestamp')) + timestamp = request.values.get('date') return index(timestamp) else: return render_template("init.html")