From 8f5938d49646af6374afce2e6cbdfdaeb24ca65e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 19 Dec 2011 22:29:52 +0000 Subject: [PATCH] Process mozilla-specific date/time representation. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@353 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- Writers/bkmk_wflad.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Writers/bkmk_wflad.py b/Writers/bkmk_wflad.py index 6b6d174..a848e6c 100644 --- a/Writers/bkmk_wflad.py +++ b/Writers/bkmk_wflad.py @@ -18,8 +18,13 @@ from bkmk_objects import Writer def strftime(s): + if s is None: + return s + n = int(s) + if n > 10**9: + n /= 10**6 try: - return time.strftime("%a %d %b %Y %T", time.localtime(int(s))) + return time.strftime("%a %d %b %Y %T", time.localtime(n)) except (TypeError, ValueError): # s is None or is already formatted return s -- 2.39.5