Make is swapping the day and month when parsing dates

:bullseye: What is your goal?

To parse a date received from Tally (in YYYY-MM-DD format), convert it to DD/MM/YYYY, and store it correctly in a Make Datastore without any changes or misinterpretation.

:thinking: What is the problem & what have you tried?

Make keeps swapping the day and month whenever the day is ≤ 12 (e.g., 2025-04-03 becomes 04/03/2025).
I used:

{{formatDate(parseDate(2.fieldsById.someField; “YYYY-MM-DD”); “DD/MM/YYYY”)}}
It appears that Make reinterprets the date as MM/DD despite the explicit parse mask.

:clipboard: Error messages or input/output bundles

No error messages. The Datastore entry simply stores the wrong date (day/month swapped), and any calculated dates based on it become incorrect as well.

Hey there,

can you share a screenshot showing the issue? When I test it, it doesn’t do that and keeps the correct order I set inside formatDate().

Sharing the screenshot. The date from tally was 1st Dec and the date stored was 12th Jan.

Oh right right right. Your data store variable is set to Date right? You dont need the formatDate when saving it, only parseDate.

For some reason Make decided to use the American date format as the default one, so when you save it using formatDate it messes them up, cause it defaults to MM/DD/YYYY. So a date like 01/12/2025 gets misinterpreted. This can be completely avoided if you don’t format the date at all and only use parseDate() so it changes the input to a date type variable as well.

2 Likes

Thank you! It helped