diff options
author | Christian Struck <christian@struck.se> | 2013-01-31 15:40:58 +0100 |
---|---|---|
committer | Christian Struck <christian@struck.se> | 2013-01-31 15:40:58 +0100 |
commit | 6a71307e5affd7653db04d9943c77cccf30c3886 (patch) | |
tree | 88775b2cbe07dc79e4f648444aebdf23eb400152 /bvggrabber/utils | |
parent | c10021e4d0e7f3cc54ecc796a4b979d92d666eb5 (diff) | |
download | bvg-grabber-6a71307e5affd7653db04d9943c77cccf30c3886.tar.gz bvg-grabber-6a71307e5affd7653db04d9943c77cccf30c3886.tar.bz2 bvg-grabber-6a71307e5affd7653db04d9943c77cccf30c3886.zip |
added function dateformat and renamed function hourformat to timeformat and removed wrong enc in actualdeparture
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 |