Incorrect work of function formatDate()

formatDate() function does not work correctly when the date comes in the format MM-DD-YYYY before the 12th of each month

  • If I understood correctly, when the formatDate function receives a date in the format MM-DD-YYYY before the 12th, the function perceives it as DD-MM-YYYY.
  • There are ways around this, to let the function know what format the input date is in.

screenshots

This is how data is processed
formatDate

this is the result of two different dates for September and December
result formatDate

Hello @Oleksandr_Tsap nice to meet you.

Can you show a screenshot with how your date input is looking?

Don’t hesitate to contact us if you require further assistance.

//VLAD

2 Likes

INPUT
date

RESULT
result date

The format for the input comes from the Power My Analytics extension in this format, it’s December 9th, and I understand how the formatDate function understands it, the question is, is there a way to specify where the month is and where the day is?

Hi Oleksandr,

try parseDate() first to tell it what the format is, then you can reformat it in whatever way you like.

4 Likes

According to the Tokens you can use to format a date variable, you can use MM-DD-YYYY.

e.g.:

formatDate(parseDate({{1.`1`}}; MM-DD-YYYY); DD/MM/YYYY)

Screenshot_2023-12-18_201235

3 Likes