mercurial/util.py
changeset 6134 7b937b26adf7
parent 6111 213ea6eed412
child 6135 be91a77b7f18
equal deleted inserted replaced
6133:779f2309d67a 6134:7b937b26adf7
  1531     s = time.strftime(format, time.gmtime(float(t) - tz))
  1531     s = time.strftime(format, time.gmtime(float(t) - tz))
  1532     if timezone:
  1532     if timezone:
  1533         s += timezone_format % (-tz / 3600, ((-tz % 3600) / 60))
  1533         s += timezone_format % (-tz / 3600, ((-tz % 3600) / 60))
  1534     return s
  1534     return s
  1535 
  1535 
       
  1536 def shortdate(date=None):
       
  1537     """turn (timestamp, tzoff) tuple into iso 8631 date."""
       
  1538     return datestr(date, format='%Y-%m-%d', timezone=False)
       
  1539 
  1536 def strdate(string, format, defaults=[]):
  1540 def strdate(string, format, defaults=[]):
  1537     """parse a localized time string and return a (unixtime, offset) tuple.
  1541     """parse a localized time string and return a (unixtime, offset) tuple.
  1538     if the string cannot be parsed, ValueError is raised."""
  1542     if the string cannot be parsed, ValueError is raised."""
  1539     def timezone(string):
  1543     def timezone(string):
  1540         tz = string.split()[-1]
  1544         tz = string.split()[-1]