Commit da85d408 authored by shadMod's avatar shadMod 💬

added try with check if 'it' is in locale setting

parent 13123a55
Pipeline #352 passed with stage
in 0 seconds
...@@ -114,8 +114,14 @@ class News: ...@@ -114,8 +114,14 @@ class News:
nr_file = str(filename.replace(".md", "")).zfill(3) nr_file = str(filename.replace(".md", "")).zfill(3)
# get last edit of file # get last edit of file
last_edit = os.stat(path).st_mtime last_edit = os.stat(path).st_mtime
# set with it language
locale.setlocale(locale.LC_TIME, "it_IT") try:
# check and set with it_IT language
if 'it_it' in locale.locale_alias:
locale.setlocale(locale.LC_TIME, "it_IT.ISO8859-1")
except:
pass
# format datetime: 01 Novembre 2023 - 00:00 # format datetime: 01 Novembre 2023 - 00:00
date_edit = datetime.fromtimestamp(last_edit) date_edit = datetime.fromtimestamp(last_edit)
data["last_edit"] = date_edit.strftime("%d %B %Y - %H:%M") data["last_edit"] = date_edit.strftime("%d %B %Y - %H:%M")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment