From 1fecedbbb319bc010da4a20dc09217be5023b80a Mon Sep 17 00:00:00 2001 From: Halhadus Date: Sat, 7 Dec 2024 00:52:35 +0300 Subject: [PATCH] Maked last update time human-readable --- websitemodule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websitemodule.py b/websitemodule.py index 40ff721..37d2857 100644 --- a/websitemodule.py +++ b/websitemodule.py @@ -1,6 +1,7 @@ import os import sqlite3 import requests +import datetime def read_music_database(url): os.remove("assets/localwrapped/music.db") @@ -40,7 +41,8 @@ def generatehtmlcode(url): html += '\n' html += '

Halhadus\' Local Wrapped

\n' html += '

Total Play Time: ' + str(int(total_play_time(url)/60)) + ' minutes

\n' - html += '

Last Updated: ' + os.path.getmtime('assets/localwrapped/count.db') + '

\n' + # HUMAN READABLE last updated time (example: 2021-09-01 12:34:56) of assets/localwrapped/music.db (UTC +3) + html += '

Last Updated: ' + datetime.datetime.utcfromtimestamp(os.path.getmtime("assets/localwrapped/music.db")).strftime('%Y-%m-%d %H:%M:%S') + ' (UTC +3)

\n' html += '

Most Played Musics

\n' html += '
    \n' count_list_formatted = []