how to insert a colon in between string as like date formats in c++ : I have string 20150410 121416 in c++

output- 20150410 12:14:16

how can i insert a colon to the string.Can anyone please help me out.