from datetime import datetime d = datetime.strptime('28122016', '%d%m%Y') print(d.strftime('%Y-%m-%d'))
Standard input is empty
2016-12-28
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!