Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 5269:46c5e1ee8aaa
Added support for the Atom syndication format
author | Robert Bachmann <rbach@rbach.priv.at> |
---|---|
date | Thu, 30 Aug 2007 16:42:17 +0200 |
parents | 335696e2a58f |
children | 32ec518ee3cb |
line wrap: on
line diff
--- a/mercurial/util.py Wed Aug 29 17:01:10 2007 -0700 +++ b/mercurial/util.py Thu Aug 30 16:42:17 2007 +0200 @@ -1448,7 +1448,7 @@ tz = time.timezone return time.mktime(lt), tz -def datestr(date=None, format='%a %b %d %H:%M:%S %Y', timezone=True): +def datestr(date=None, format='%a %b %d %H:%M:%S %Y', timezone=True, timezone_format=" %+03d%02d"): """represent a (unixtime, offset) tuple as a localized time. unixtime is seconds since the epoch, and offset is the time zone's number of seconds away from UTC. if timezone is false, do not @@ -1456,7 +1456,7 @@ t, tz = date or makedate() s = time.strftime(format, time.gmtime(float(t) - tz)) if timezone: - s += " %+03d%02d" % (-tz / 3600, ((-tz % 3600) / 60)) + s += timezone_format % (-tz / 3600, ((-tz % 3600) / 60)) return s def strdate(string, format, defaults):