From: Simo Leone Date: Tue, 13 Mar 2007 07:33:35 +0000 (-0500) Subject: Implemented timezone migration X-Git-Url: https://repo.or.cz/w/darcs2git.git/commitdiff_plain/8cf91cca3d054835c1a21f91d913ae66b05b59f0 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. --- 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