Format "Date" in a Formula to "tt/mm/jjjj"

Hye

How is it possible to change the formate of a date in a formula
form “mm/tt/jjjj”
to “tt/mm/jjjj”

Hi @Kristijan_Moser,

Try this:
[Your Date].split("/").Format("{2:00}/{1:00}/{3}")

Cheers!

THX
¨
this work, but I get a new problem.
the value is formatted correctly, but is not recognized as a date. The date is used to filter a table. The filter no longer works because a date is expected but a text is received.

how can the formatted text be recognized again as a date and displayed as usual.

—> ok, solved it. Made a new row and:

Date(
thisRow.Datum.Split("/").Format("{3:00}"),
thisRow.Datum.Split("/").Format("{2:00}"),
thisRow.Datum.Split("/").Format("{1:00}"))

Hi @Kristijan_Moser,

Good point.

Warning:
Be aware that the way the column displays the date depends on the column settings of the Date data type.
So, if you need to show a Date field still as Date but in a different format within a column, you should change those settings.

Example:
If a date is 1/9/2020 (Jan 9th) you can format as
thisRow.split("/").Format("{2:00}/{1:00}/{3}")
to display 09/01/2020.
But if you set it to date (thisRow.split("/").Format("{2:00}/{1:00}/{3}").ToDate())
it will change the date to Sep 1st.

(you can check it my adding thisRow.split("/").Format("{2:00}/{1:00}/{3}").ToDate().MonthName())

1 Like

Thanks @Federico_Stefanato

I can now confirm the warning :-).
I’ve changed the whole thing so that the format change is not necessary.

1 Like