HSBC interview question

String manipulation code for dates