2019-03-18 Python time 将2015年11月20日转换为2015-11-20

    #ReportingDate = soup.select('body > div.main > div > div.ctr > div.recruit > ul > li > a')[0].text.split('(')[-1].split(')')[0]
    ReportingDate ="2015年11月20日"
    array = time.strptime(ReportingDate, u"%Y年%m月%d日")
    try:
        ReportingDates = time.strftime("%Y-%m-%d", array)
    except Exception as e:
        print(e)

  

posted @ 2019-03-18 17:59  theDataDigger  阅读(107)  评论(0编辑  收藏  举报