>>> from datetime import datetime>>> datetime.strptime('02/11/2010', '%d/%m/%Y').strftime('%Y-%m-%d')'2010-11-02'
>>> '-'.join('02/11/2010'.split('/')[::-1])'2010-11-02'>>> '-'.join(reversed('02/11/2010'.split('/')))'2010-11-02'
欢迎分享,转载请注明来源:内存溢出
>>> from datetime import datetime>>> datetime.strptime('02/11/2010', '%d/%m/%Y').strftime('%Y-%m-%d')'2010-11-02'
>>> '-'.join('02/11/2010'.split('/')[::-1])'2010-11-02'>>> '-'.join(reversed('02/11/2010'.split('/')))'2010-11-02'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)