Mercurial > public > mercurial-scm > hg-stable
diff hgext/patchbomb.py @ 6229:c3182eeb70ea
dates: improve timezone handling
datestr:
- add format specifiers %1 and %2 for timezone hours and minutes
- remove timezone and timezone format options
- correctly find timezone hours and minutes for fractional and negative timezones
- update users
strdate:
- correctly find timezone hours and minutes for fractional and negative timezones
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 11 Mar 2008 17:42:41 -0500 |
parents | e75aab656f46 |
children | 9d2ce19bdacd |
line wrap: on
line diff
--- a/hgext/patchbomb.py Tue Mar 11 17:42:29 2008 -0500 +++ b/hgext/patchbomb.py Tue Mar 11 17:42:41 2008 -0500 @@ -391,8 +391,7 @@ m['In-Reply-To'] = parent else: parent = m['Message-Id'] - m['Date'] = util.datestr(date=start_time, - format="%a, %d %b %Y %H:%M:%S", timezone=True) + m['Date'] = util.datestr(start_time, "%a, %d %b %Y %H:%M:%S %1%2") start_time = (start_time[0] + 1, start_time[1]) m['From'] = sender @@ -419,8 +418,7 @@ elif opts.get('mbox'): ui.status('Writing ', m['Subject'], ' ...\n') fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+') - date = util.datestr(date=start_time, - format='%a %b %d %H:%M:%S %Y', timezone=False) + date = util.datestr(start_time, '%a %b %d %H:%M:%S %Y') fp.write('From %s %s\n' % (sender_addr, date)) fp.write(m.as_string(0)) fp.write('\n\n')