From 8cf91cca3d054835c1a21f91d913ae66b05b59f0 Mon Sep 17 00:00:00 2001 From: Simo Leone Date: Tue, 13 Mar 2007 02:33:35 -0500 Subject: [PATCH] Implemented timezone migration This patch implements timezone conversion. It's a bit of an abuse of the email.utils module but it seems to work fine. --- darcs2git.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/darcs2git.py b/darcs2git.py index 618102a..bbcb739 100644 --- a/darcs2git.py +++ b/darcs2git.py @@ -28,6 +28,7 @@ import re import gdbm as dbmodule import gzip import optparse +from email.utils import parsedate_tz ################################################################ # globals @@ -187,10 +188,8 @@ def darcs_date_to_git (x): return '%d' % int (time.mktime (t)) def darcs_timezone (x) : - time.strptime (x, '%a %b %d %H:%M:%S %Z %Y') - - # todo - return "+0100" + tz = parsedate_tz(x)[9] / 60 + return "%+03d%02d" % (tz / 60, tz % 60) ################################################################ # darcs -- 2.11.4.GIT