def hyphenate_date(date_str):
 match = re.match(u'^(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$', date_str)
 if (match is not None):
  return u'-'.join(match.groups())
 else:
  return date_str

def hyphenate_date ( date_str ) : match = re . match ( u'^(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$' , date_str ) if ( match is not None ) : return u'-' . join ( match . groups ( ) ) else : return date_str
convert a date in yyyymmdd format to yyyy-mm-dd format .