Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.

Change date format

Avatar

Level 2
Level 2

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!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Level 2

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

Avatar

Community Advisor

@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

Avatar

Level 2
Level 2

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

 

Avatar

Administrator

Hi @SatheeskannaK,

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

Thanks!



Sukrity Wadhwa