03-10-2020 08:00 AM
Hi ,
I am having a source csv file which contains the date in the format dd-MON-yyyy ( say for example 01-JAN-2020 ) . I need to convert this data format to the form yyyy-mm-dd ( say 2020-01-01 ) . I have tried using various methods to parse the date but could not achieve the conversion . So I have used the conditional mapping here and the code gets bigger as I need to incorporate 12 months and hard code the values . Please refer below
$Review_Date.split(‘-’)[2]+‘-’+$Review_Date.split(‘-’)[1]==‘Jan’?‘01’:($Review_Date.split(‘-’)[1]==‘Feb’?‘02’:‘00’)+‘-’+$Review_Date.split(‘-’)[0]……
Is there any optimised way in achieving the above scenario .
03-10-2020 08:42 AM
Hi Harsha3
Can you please check if the following expression resolves your query?
Date.parse(“01-JAN-2020”, “dd-MMM-yyyy”)
You can place the “01-JAN-2020” with any value from input as following:
Date.parse($Review_Date, “dd-MMM-yyyy”)
Regards, Jovan.
03-10-2020 09:11 AM
Hi Jovan,
Excellent it worked . Cheers!
04-22-2020 01:59 AM
What if “01-Jan-2020”, how do I put the mask?