diff options
Diffstat (limited to 'src/pyssg/utils.py')
-rw-r--r-- | src/pyssg/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pyssg/utils.py b/src/pyssg/utils.py index b1ed8c1..d391ccf 100644 --- a/src/pyssg/utils.py +++ b/src/pyssg/utils.py @@ -3,6 +3,7 @@ import sys import shutil from hashlib import md5 from logging import Logger, getLogger +from datetime import datetime, timezone log: Logger = getLogger(__name__) @@ -106,3 +107,8 @@ def get_expanded_path(path: str) -> str: sys.exit(1) log.debug('expanded path "%s" to "%s"', path, expanded_path) return expanded_path + + +def get_time_now(fmt: str, tz: timezone=timezone.utc) -> str: + return datetime.now(tz=tz).strftime(fmt) + |