summaryrefslogtreecommitdiff
path: root/src/leap/common/files.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-09-20 21:15:08 +0200
committerKali Kaneko <kali@leap.se>2017-09-20 21:24:37 +0200
commite4587411f03d768e3b74b9466f89355754d72597 (patch)
tree45428be05d290755f02589129b0f2835e759791c /src/leap/common/files.py
parent985cb1210b13ec204ef078296f853d7692658eee (diff)
[bug] add proper formatting for mtime
Diffstat (limited to 'src/leap/common/files.py')
-rw-r--r--src/leap/common/files.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/leap/common/files.py b/src/leap/common/files.py
index bba281b..84e9015 100644
--- a/src/leap/common/files.py
+++ b/src/leap/common/files.py
@@ -59,8 +59,9 @@ def get_mtime(filename):
:rtype: str
"""
try:
- mtime = time.ctime(os.path.getmtime(filename)) + " GMT"
- return mtime
+ return time.strftime(
+ '%a, %d %b %Y %H:%M:%S GMT', time.gmtime(
+ os.path.getmtime(filename)))
except OSError:
return None