Mercurial > hg-stable
changeset 2445:e58889a9d378
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 16 Jun 2006 08:52:28 -0700 |
parents | bd9c39e8f38b (diff) 5eb02f9ed804 (current diff) |
children | 1b2bbb2b4911 |
files | |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/patchbomb.py Fri Jun 16 10:00:37 2006 -0300 +++ b/hgext/patchbomb.py Fri Jun 16 08:52:28 2006 -0700 @@ -217,7 +217,14 @@ if not opts['test'] and not opts['mbox']: mail = ui.sendmail() parent = None - tz = time.strftime('%z') + + # Calculate UTC offset + if time.daylight: offset = time.altzone + else: offset = time.timezone + if offset <= 0: sign, offset = '+', -offset + else: sign = '-' + offset = '%s%02d%02d' % (sign, offset / 3600, (offset % 3600) / 60) + sender_addr = email.Utils.parseaddr(sender)[1] for m in msgs: try: @@ -228,7 +235,8 @@ m['In-Reply-To'] = parent else: parent = m['Message-Id'] - m['Date'] = time.strftime('%a, %e %b %Y %T ', time.localtime(start_time)) + tz + m['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime(start_time)) + ' ' + offset + start_time += 1 m['From'] = sender m['To'] = ', '.join(to)