don't use system tz, display timestamps as UTC
no particular reason, just one less dependency, and it goes further towards my idyllic world where everyone is on UTC and there are no timezones
This commit is contained in:
parent
d129d04e04
commit
63a764c6a0
@ -7,7 +7,6 @@ import re
|
||||
from flask import Blueprint, Markup, abort
|
||||
from flask import current_app as app
|
||||
from flask import redirect, request, send_from_directory
|
||||
from tzlocal import get_localzone
|
||||
|
||||
from incorporealcms.lib import get_meta_str, init_md, render
|
||||
|
||||
@ -51,7 +50,7 @@ def handle_markdown_file_path(resolved_path):
|
||||
try:
|
||||
logger.debug("opening resolved path '%s'", resolved_path)
|
||||
with app.open_instance_resource(resolved_path, 'r') as entry_file:
|
||||
mtime = datetime.datetime.fromtimestamp(os.path.getmtime(entry_file.name), get_localzone())
|
||||
mtime = datetime.datetime.fromtimestamp(os.path.getmtime(entry_file.name), tz=datetime.timezone.utc)
|
||||
entry = entry_file.read()
|
||||
logger.debug("resolved path '%s' read", resolved_path)
|
||||
except OSError:
|
||||
|
@ -116,8 +116,6 @@ pytest==7.1.1
|
||||
# pytest-cov
|
||||
pytest-cov==3.0.0
|
||||
# via -r requirements/requirements-dev.in
|
||||
pytz-deprecation-shim==0.1.0.post0
|
||||
# via tzlocal
|
||||
pyyaml==6.0
|
||||
# via
|
||||
# bandit
|
||||
@ -154,10 +152,6 @@ tox==3.24.5
|
||||
# tox-wheel
|
||||
tox-wheel==0.7.0
|
||||
# via -r requirements/requirements-dev.in
|
||||
tzdata==2022.1
|
||||
# via pytz-deprecation-shim
|
||||
tzlocal==4.1
|
||||
# via -r requirements/requirements.in
|
||||
urllib3==1.26.9
|
||||
# via requests
|
||||
versioneer==0.22
|
||||
|
@ -1,3 +1,2 @@
|
||||
Flask # general purpose web service and web server stuff
|
||||
Markdown # markdown rendering in templates
|
||||
tzlocal # identifying system's local timezone
|
||||
|
@ -16,11 +16,5 @@ markdown==3.3.6
|
||||
# via -r requirements/requirements.in
|
||||
markupsafe==2.1.1
|
||||
# via jinja2
|
||||
pytz-deprecation-shim==0.1.0.post0
|
||||
# via tzlocal
|
||||
tzdata==2022.1
|
||||
# via pytz-deprecation-shim
|
||||
tzlocal==4.1
|
||||
# via -r requirements/requirements.in
|
||||
werkzeug==2.0.3
|
||||
# via flask
|
||||
|
Loading…
x
Reference in New Issue
Block a user