note that time is UTC

This commit is contained in:
veclav talica 2023-05-23 00:03:16 +05:00
parent 969d7ee5c1
commit 94af318b89
2 changed files with 3 additions and 3 deletions

View File

@ -27,13 +27,13 @@ if not brief is None:
date = metadata.get("Date") date = metadata.get("Date")
if not date is None: if not date is None:
article_head += f"-- Created: *{MONTHS[date.tm_mon]} {date.tm_mday}, {date.tm_year}*\n\n" article_head += f"-- Created: *{MONTHS[date.tm_mon]} {date.tm_mday}, {date.tm_year} UTC*\n\n"
last_edit = metadata.get("Last Edit") last_edit = metadata.get("Last Edit")
if not last_edit is None: if not last_edit is None:
if date is None or last_edit.tm_mon != date.tm_mon or \ if date is None or last_edit.tm_mon != date.tm_mon or \
last_edit.tm_mday != date.tm_mday or last_edit.tm_year != date.tm_year: last_edit.tm_mday != date.tm_mday or last_edit.tm_year != date.tm_year:
article_head += f"-- Edited: *{MONTHS[last_edit.tm_mon]} {last_edit.tm_mday}, {last_edit.tm_year}*\n\n" article_head += f"-- Edited: *{MONTHS[last_edit.tm_mon]} {last_edit.tm_mday}, {last_edit.tm_year} UTC*\n\n"
# todo: Hyperlinks to appropriate tag pages. # todo: Hyperlinks to appropriate tag pages.
tags = metadata.get("Tags") tags = metadata.get("Tags")

View File

@ -40,6 +40,6 @@ for root, dirs, _ in walk(argv[1]):
page += f""">*{','.join(metadata["Tags"])}*\n---\n""" page += f""">*{','.join(metadata["Tags"])}*\n---\n"""
curtime = time.gmtime(int(time.time())) curtime = time.gmtime(int(time.time()))
page += f"Last compiled: *{MONTHS[curtime.tm_mon]} {curtime.tm_mday}, {curtime.tm_year} {curtime.tm_hour}:{curtime.tm_min:02d}*\n\n" page += f"Last compiled: *{MONTHS[curtime.tm_mon]} {curtime.tm_mday}, {curtime.tm_year} {curtime.tm_hour}:{curtime.tm_min:02d} UTC*\n\n"
print(page_metadata + wrap_page(page)) print(page_metadata + wrap_page(page))