changeset 4890:9ff4b82f56c9

date representation: use ISO8601 rather than a specific locale Dates, in particular in technical systems like Kallithea, are better shown in a clear concise format like ISO8601 (YYYY-MM-DD) than in a verbose format like 'Thu, Feb 26 2015'. This commit changes all dates to ISO8601. --- If desired, we could create two functions: one that returns ISO format and another for the locale format. Depending on the usage, one or the other is shown. I'm not very fond of that though, it looks inconsistent.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Thu, 26 Feb 2015 22:51:27 +0100
parents 5a1cd703a888
children a7bbf4e18ec3
files kallithea/lib/helpers.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/helpers.py	Thu Feb 26 16:44:47 2015 +0100
+++ b/kallithea/lib/helpers.py	Thu Feb 26 22:51:27 2015 +0100
@@ -469,8 +469,7 @@
 
 def fmt_date(date):
     if date:
-        _fmt = u"%a, %d %b %Y %H:%M:%S".encode('utf8')
-        return date.strftime(_fmt).decode('utf8')
+        return date.strftime("%Y-%m-%d %H:%M:%S").decode('utf8')
 
     return ""