diff options
Diffstat (limited to 'bvggrabber/utils')
-rw-r--r-- | bvggrabber/utils/format.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bvggrabber/utils/format.py b/bvggrabber/utils/format.py index 603124b..d39868a 100644 --- a/bvggrabber/utils/format.py +++ b/bvggrabber/utils/format.py @@ -12,7 +12,7 @@ def fullformat(dt): return dt.strftime('%Y-%m-%d %H:%M:%S') -def hourformat(dt): +def timeformat(dt): """Formats a datetime object as HH:MM :param datetime dt: The datetime.datetime object to format @@ -23,6 +23,17 @@ def hourformat(dt): return dt.strftime('%H:%M') +def dateformat(dt): + """Formats a datetime object as dd.mm.yyyy + + :param datetime dt: The datetime.datetime object to format + :return: A formattet string + :rtype: str + + """ + return dt.strftime('%d.%m.%Y') + + def int2bin(i, length=8): """Returns the bit representation of the given integer with a minimum length of ``length``. E.g. ``int2bin(109, 7) == '1101101'`` and |