โ08-13-2021 07:35 AM
I am doing date conversion. But not sure why it is changing the date.
Input Date is : โ29-JUN-21 10.07.35.000000 AMโ
Output date is becoming :โ2020-12-27 10:07:35โ
The conversion I am using is :
Date.parse($OrderDetailCreateDate,โdd-MMM-YY hh.mm.ss.SSSSSS aaโ).toLocaleDateTimeString( { โformatโ:โyyyy-MM-dd HH:mm:ssโ } )
โ08-13-2021 07:52 AM
Hi Shrabanti,
Can you please try with the below date function? Just changed the year format โYYโ to โyyโ
Date.parse(โ29-JUN-21 10.07.35.000000 AMโ,โdd-MMM-yy hh.mm.ss.SSSSSS aaโ).toLocaleDateTimeString( { โformatโ:โyyyy-MM-dd HH:mm:ssโ } )
โ08-13-2021 01:12 PM
Hi @Shrabanti ,
Your expression looks good, and only needs 2 changes. Year should be lowercase letters, and Hours should be uppercase. The expression needs to look like this:
Date.parse('29-JUN-21 10.07.35.000000 AM','dd-MMM-yy HH.mm.ss.SSSSSS aa').toLocaleDateTimeString( { "format":"yyyy-MM-dd HH:mm:ss" } )
@Sowmya_Rayavarapuโs expression is nearly identical, and also works.
Regards,
Bojan