Hi Ranjeet,
Assuming your text is stored in a variable DateText, you can use the following (change DateText to the name of the variable you have the text):
FormatDateTime(NewDate(TextToInteger(Substr(DateText,0,4)), TextToInteger(Substr(DateText,4,2)), TextToInteger(Substr(DateText,6,2))), "yyyy-MM-dd")
Basically, it creates a new date using the first 4 digits for year, the next 2 for month and the last 2 for day, and uses the format function to format it into to the yyyy-MM-dd format you want.
Regards,
João