python处理时间格式转换,将xxxx年xx月xx日转化为xxxx-xx-xx格式 def conversion_date(date): """ 转换日期格式。 :param date: 00000000格式日期 :return: 0000/00/00格式日期 """ return time.strftime("%Y-%m-%d", time.strptime(date, "%Y%m%d"))