0

I'm looking to convert a data field value (@OPT2) from "01-Feb-22" into "01-02-22" to be displayed on a landing page. The reason is I want to display the date in French too and having Feb in the is not allowing me to display the date in French. Here is the code i'm using so far

        VAR @OPT2, @FormattedDate
        SET @OPT2 = QueryParameter("OPT2")
        SET @FormattedDate = Format(@OPT2, "d MMMM yyyy", "Date", "fr-CA")
       ]%%-->```
It will be output using:
```%%=V(@FormattedDate)=%%```

Thank you

1 Answer 1

1

You can use FormatDate function in AMPscript to do that. Try this:

%%[
VAR @OPT2, @FormattedDate
        SET @OPT2 = QueryParameter("OPT2")
        SET @FormattedDate = FormatDate(@OPT2, 'dd-MM-yy')
]%%
%%=v(@FormattedDate)=%%
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .