How can i convert date format yyyyMMdd to yyyy-MM-dd ?
Example :
20200129 need to change 2020-01-29 in this format
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
Good day!
As far as I know, for that, you have to manually break the string to align with the expected date format conversion. But we can for other members to have their comments.
Thank you and kind regards,
Chris
You can simply split the text and add hyphens between themSubstr(DateText,0,4))+ "-" + Substr(DateText,4,2) + "-" + Substr(DateText,6,2
Regards,