mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add util.timezone_to_datetime -> dt
Jinja2 filter
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
f89d06d092
commit
ac67268a28
3 changed files with 16 additions and 0 deletions
|
@ -97,6 +97,10 @@ def account_url(context, user):
|
|||
return f"{base}/account/{user.Username}"
|
||||
|
||||
|
||||
def timestamp_to_datetime(timestamp: int):
|
||||
return datetime.utcfromtimestamp(int(timestamp))
|
||||
|
||||
|
||||
def jsonify(obj):
|
||||
""" Perform a conversion on obj if it's needed. """
|
||||
if isinstance(obj, datetime):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue