cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot format date correctly to YYYY-MM-DD

NAl
Contributor

Hi there,

I’ve looked at other articles addressing this but non has helped me so far.

Im looking to format a date in the DD/MM/YYYY to YYYY-MM-DD.
The date will always be populated.

I’ve tried the following expressions but they wont process correctly

Date.parse($original[‘Due Date’], “yyyy MM dd”)

LocalDate.parse($original[‘Due Date’],“yyyy/MM/dd”)
If I use the above expression and if the date is 06/04/2021, the output date becomes 0006-04-18. It’s inexplicable.

12 REPLIES 12

How do I open the sample pipeline in Snaplogic? The file downloads to my desktop and cannot find the appropriate application to open it. I’m a newbie with SnapLogic so still trying to find my feet.

You should use import option from designer to import this sample pipeline directly to your Snaplogic.

SpiroTaleski
Valued Contributor

@NAl

Click on “Import a Pipeline” button, and then open/select the appropriate sample pipeline that you want to import.

image

Regards,
Spiro Taleski

Thank you Spiro, found it

NAl
Contributor

Okay so the Date/Time Extractor is not available in our packs which is fine.

Using the expression provided, the date still doesn’t format properly.
The input date is 06/04/2021 but in the expression appears as 0021-06-04