Time format Conversion not working

Hi All,
I am trying change a data format with expression.

Input is a string value: “9-JUN-21 AM”
Output should be ‘yyyy-MM-dd HH:mm:ss’ format

I am trying data parse the incoming date format but unable find proper format for input date.
Date.parse($OrderDetailUpdateDate,“dd-MMM-yyyy’ 'HH:mm:ss.SSSXXX AM”).toLocaleDateTimeString({“format”:“yyyy-MM-dd HH:mm:ss”})

Could you please siggest.

Hi @Shrabanti - I think this is what you’re looking for:

Date.parse(“9-JUN-21 AM”, “dd-MMM-YY hh.mm.ss.SSSSSS aa” ).toLocaleDateTimeString( { “format” : “yyyy-MM-dd HH:mm:ss” } )

SnapLogic date parsing using Joda formatting. Here is a good reference on the format strings:

Thank you it worked…