--- a/hgext/patchbomb.py Thu Jun 15 17:07:30 2006 -0700
+++ b/hgext/patchbomb.py Fri Jun 16 07:07:11 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)