1 text是xxxx年xx月xx日

re.sub('年月','-',text[:-1]).

 

2

import time
def datetrans(text):
    dates = time.strptime(text, "%Y年%m月%d日")
    return time.strftime("%Y-%m-%d", dates)

 

相关文章:

  • 2022-02-10
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案