mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
configd: Jinja helper function to show current iso timestamp in local timezone. closes https://github.com/opnsense/core/issues/5341
At the moment further refactoring of the template code is likely not needed, let's keep the helper functions statically in template_helpers.py for now
This commit is contained in:
parent
2850c263c8
commit
368e7ac15e
@ -25,6 +25,7 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
import datetime
|
||||
import glob
|
||||
import collections
|
||||
import netaddr
|
||||
@ -142,6 +143,13 @@ class Helpers(object):
|
||||
"""
|
||||
return netaddr.IPNetwork(network)
|
||||
|
||||
@staticmethod
|
||||
def getUtcTime():
|
||||
""" return UTC timestamp in ISO 8601 format with second granularity
|
||||
:return: string
|
||||
"""
|
||||
return datetime.datetime.utcnow().astimezone().isoformat(timespec="seconds")
|
||||
|
||||
@staticmethod
|
||||
def sortDictList(lst, *operators):
|
||||
if type(lst) == list:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user