Change date format | Community
Skip to main content
Level 2
June 10, 2025
Question

Change date format

  • June 10, 2025
  • 2 replies
  • 515 views

Hi there,

 

I'm trying to change the date the below expression appears which is YYYY-MM-DD to DD MM YYYY in a field in Custom Action. I tried the followings but didn't work. Note this is a piece of code that forms a more complex if/else formula.

1) formatDate

2) toDateOnly

3) date

4) dformat

5) format

 

Expression to solve:

then(concat("on ", (toString(getListItem(sort(#{XXX}, true), 0)))))

 

Thanks!

2 replies

Level 2
June 10, 2025

Hi @ak5 ,

 

Are you trying to save the date in a list field?

If so, why don't you read the date parameters directly and then perform the concat expression?

 

Thanks,

Pankaj

SatheeskannaK
Community Advisor
Community Advisor
June 10, 2025

@ak5 Try along these lines,

 

concat(concat(concat(concat(substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),8,10),"-"),substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),5,7)),"-"),substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),0,4))

 

Example,
birthdate on the profile:2023-11-27
birthdateFormatted:27-11-2023
Thanks, Sathees
AK5Author
Level 2
June 11, 2025

Hi @satheeskannak, appreciate the prompt reply! Almost there my bad, i should say the format is 27 Nov 2023. Any ideas? Thanks

 

Sukrity_Wadhwa
Community Manager
Community Manager
June 18, 2025

Hi @satheeskannak,

Can you confirm if the suggested solution would work for the new format that @ak5 is asking for?

Thanks!

Sukrity Wadhwa