diff options
author | Georgy Redkozubov <georgy.redkozubov@linaro.org> | 2012-08-27 14:56:15 +0400 |
---|---|---|
committer | Georgy Redkozubov <georgy.redkozubov@linaro.org> | 2012-08-27 14:56:15 +0400 |
commit | 03eb90e542a08728bfe17c62b7a6d21c7ad2a920 (patch) | |
tree | 705050baa90c2067a205aaa554fd3855fe01a288 /license_protected_downloads | |
parent | c9294401bc1ef842336d658b148c0c8b0f1f20ab (diff) |
Switch to use datetime module instead of time
Diffstat (limited to 'license_protected_downloads')
-rw-r--r-- | license_protected_downloads/views.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/license_protected_downloads/views.py b/license_protected_downloads/views.py index a78b957..d9c3646 100644 --- a/license_protected_downloads/views.py +++ b/license_protected_downloads/views.py @@ -5,6 +5,7 @@ import os import re import time from mimetypes import guess_type +from datetime import datetime from django.conf import settings from django.http import ( @@ -67,8 +68,7 @@ def dir_list(url, path): file = os.path.join(path, file) if os.path.exists(file): - mtime = time.strftime('%d-%b-%Y %H:%M', - time.localtime(os.path.getmtime(file))) + mtime = datetime.fromtimestamp(os.path.getmtime(file)).strftime('%d-%b-%Y %H:%M') else: # If the file we are looking at doesn't exist (broken symlink for # example), it doesn't have a mtime. |