fork download
  1. from dateutil.parser import parse as parseDate
  2. from datetime import datetime, time, timedelta
  3. from time import strftime
  4.  
  5. chaine = '16/12/201602:15:00'
  6. dt = datetime.strptime(chaine, '%d/%m/%Y%I:%M:%S')
  7. # 16/12/2016 2:15:00
  8. print(dt.strftime("%Y/%m/%d %H:%M:%S"))
  9. #2016-12-16 02:15:00
  10. print(dt.strftime("%Y-%m-%d %H:%M:%S"))
  11. # 20161216 021500
  12. print(dt.strftime("%Y%m%d %H%M%S"))
  13.  
Success #stdin #stdout 0.01s 9864KB
stdin
Standard input is empty
stdout
2016/12/16 02:15:00
2016-12-16 02:15:00
20161216 021500