From: Oleg Broytman Date: Mon, 19 Dec 2011 22:29:52 +0000 (+0000) Subject: Process mozilla-specific date/time representation. X-Git-Tag: v4.5.3~23 X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=commitdiff_plain;h=8f5938d49646af6374afce2e6cbdfdaeb24ca65e Process mozilla-specific date/time representation. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@353 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- 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