fork(3) download
  1. data = '28122016'
  2.  
  3. dia = int(data[:2])
  4. mes = int(data[2:4])
  5. ano = int(data[4:])
  6.  
  7. print('{:4d}-{:2d}-{:2d}'.format(ano, mes, dia))
Success #stdin #stdout 0.02s 9992KB
stdin
Standard input is empty
stdout
2016-12-28