Any tipps how I can add a given amount of days to a given datetime profile attribute?
E.g.
profile.mydate + 100 days
Thursday, 11 November 2021 + 100 days = Saturday, 19 February 2022
I checked https://experienceleague.adobe.com/docs/journey-optimizer/using/personalization/functions/dates.html... but couldn't find a way to achieve this.
Thank you!
Solved! Go to Solution.
Views
Replies
Total Likes
I have found a solution for calculated dates:
{% let d2 = currentTimeInMillis() + 14*86400000 %}
{% let ourDate = toDateTimeOnly(d2) %}
{%= formatDate(ourDate, "dd/MM/yyyy") %}
Haven't experienced this yet. Please reach out to clientcare@adobe.com
Hi @maggod , you could try a profile script similar to one show in the document here (this will have to be done in Target):
Views
Replies
Total Likes
Views
Replies
Total Likes
hey @maggod can you help me to understand the usecase? Is this for a condition check, or you are trying to append data? Or just format/change a string?
Views
Replies
Total Likes
Hi Ivan
I wanted to render some personalized text into AJO message content.
Example:
"Your contract will end Sept 1st 2022".
"Sept 1st 2022" should be calculated based on a profile attribute (like "contract/abc/contractStartDate") plus 2 years.
Views
Replies
Total Likes
Hi, I'm currently trying to do the exact same thing (add 7 days to a dateTime field to get a new dateTime that is 7 days in the future). Is there already a solution or workaround for this?
Views
Replies
Total Likes
I am also trying to do the same thing. But it does not work. Please help me if anyone knows the solution.
I tried to use it:
{% let d = today %}
{%= formatDate(setDays(d,7), "D/MM/YYYY") %}
but shows like this if today is 21st August, it will show 217-08-2023
Views
Replies
Total Likes
Setdays is not right function to use in the scenario mentioned , try with nowwithdelta function
@Anuhya-Y ,
Thank you so much for your suggestion. I have also tried with now with delta function. It says unknown function error. Do you know any detailed documentation? May be i am using it in a wrong way?
Views
Replies
Total Likes
@Zahid_14 I tested nowwithdelta function now, seeing the same error "unknown function". I would recommend please reach out to Adobe support on this issue and do share the solution here once you have.
@Anuhya-Y
Thanks for checking. I have already submitted a ticket. It seems this function is not available (Calculated date). There is another way but it also gives wrong date like if you add 10 days today, it will show 32-August-2023.
I have found a solution for calculated dates:
{% let d2 = currentTimeInMillis() + 14*86400000 %}
{% let ourDate = toDateTimeOnly(d2) %}
{%= formatDate(ourDate, "dd/MM/yyyy") %}
How to convert the specific date attribute value into milliseconds. So that we will use that attribute instead of currentTimeInMillis() like
{% let d2 = profile.dateAttribute + 14*86400000 %}
{% let ourDate = toDateTimeOnly(d2) %}
{%= formatDate(ourDate, "dd/MM/yyyy") %}