From 089d028e8fb7156727c4dcc9066a20cc87f53ba4 Mon Sep 17 00:00:00 2001 From: Josip Date: Sat, 16 May 2015 04:50:07 +0200 Subject: [PATCH] 8562: Cannot create family lines diagram --- gramps/gen/datehandler/_dateutils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps/gen/datehandler/_dateutils.py b/gramps/gen/datehandler/_dateutils.py index e35cac004..62e984b70 100644 --- a/gramps/gen/datehandler/_dateutils.py +++ b/gramps/gen/datehandler/_dateutils.py @@ -27,6 +27,7 @@ Class handling language-specific selection for date parser and displayer. # Python modules # #------------------------------------------------------------------------- +import sys import time #------------------------------------------------------------------------- @@ -35,6 +36,7 @@ import time # #------------------------------------------------------------------------- from ..lib.date import Date +from ..const import GRAMPS_LOCALE as glocale from . import LANG_TO_DISPLAY, LANG, parser, displayer #-------------------------------------------------------------- @@ -94,4 +96,7 @@ def format_time(secs): """ t = time.localtime(secs) d = Date(t.tm_year, t.tm_mon, t.tm_mday) - return displayer.display(d) + time.strftime(' %X', t) + if sys.version_info[0] < 3: + return displayer.display(d) + time.strftime(' %X', t).decode(glocale.encoding) + else: + return displayer.display(d) + time.strftime(' %X', t)