comparison mercurial/util.py @ 1953:379ab45b91b7

change default strftime format for better portability On some systems, such as Solaris and HP-UX, "%c" format give output without the leading zero on the single-digit month-day.
author TK Soh <teekaysoh@yahoo.com>
date Tue, 14 Mar 2006 22:01:30 -0800
parents 696230e52e4d
children f92cf4a8cedd
comparison
equal deleted inserted replaced
1951:696230e52e4d 1953:379ab45b91b7
740 tz = time.altzone 740 tz = time.altzone
741 else: 741 else:
742 tz = time.timezone 742 tz = time.timezone
743 return time.mktime(lt), tz 743 return time.mktime(lt), tz
744 744
745 def datestr(date=None, format='%c'): 745 def datestr(date=None, format='%a %b %d %H:%M:%S %Y'):
746 """represent a (unixtime, offset) tuple as a localized time. 746 """represent a (unixtime, offset) tuple as a localized time.
747 unixtime is seconds since the epoch, and offset is the time zone's 747 unixtime is seconds since the epoch, and offset is the time zone's
748 number of seconds away from UTC.""" 748 number of seconds away from UTC."""
749 t, tz = date or makedate() 749 t, tz = date or makedate()
750 return ("%s %+03d%02d" % 750 return ("%s %+03d%02d" %